win-pvdrivers

view liblfds.6/test/makefile.linux @ 1025:aa2e51f67f7c

Fix hibernate under Win8. Change debugprints.
author James Harper <james.harper@bendigoit.com.au>
date Tue Feb 19 15:14:53 2013 +1100 (2013-02-19)
parents 6300617040e0
children
line source
1 ##### paths #####
2 BINDIR = bin
3 INCDIR = ../inc
4 LIBDIR = ../bin
5 OBJDIR = obj
6 SRCDIR = src
8 ##### misc #####
9 QUIETLY = 1>nul 2>nul
11 ##### sources, objects and libraries #####
12 BINNAME = test
13 BINARY = $(BINDIR)/$(BINNAME)
14 SRCDIRS = .
15 SOURCES = abstraction_cpu_count.c test_abstraction.c abstraction_thread_start.c abstraction_thread_wait.c benchmark_freelist.c benchmark_queue.c benchmark_ringbuffer.c benchmark_stack.c test_freelist.c main.c misc.c test_queue.c test_ringbuffer.c test_slist.c test_stack.c
16 OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
17 SYSLIBS = -lpthread -lc -lm
18 USRLIBS = -llfds
20 ##### CPU variants #####
21 GCCARCH = $(shell uname -m)
23 ifeq ($(GCCARCH),x86_64)
24 GCCARCH = core2
25 endif
27 ifeq ($(findstring arm,$(GCCARCH)),arm)
28 GCCARCH = armv6k
29 endif
31 ##### tools #####
32 MAKE = make
33 MFLAGS =
35 DG = gcc
36 DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)"
38 CC = gcc
39 CFBASE = -Wall -Wno-unknown-pragmas -std=c99 -march=$(GCCARCH) -c -I"$(SRCDIR)" -I"$(INCDIR)"
40 CFREL = -O2 -Wno-strict-aliasing
41 CFDBG = -O0 -g
43 LD = gcc
44 LFBASE = -L"$(LIBDIR)"
45 LFREL = -O2 -s
46 LFDBG = -O0 -g
48 ##### variants #####
49 CFLAGS = $(CFBASE) $(CFDBG)
50 LFLAGS = $(LFBASE) $(LFDBG)
52 ifeq ($(MAKECMDGOALS),rel)
53 CFLAGS = $(CFBASE) $(CFREL)
54 LFLAGS = $(LFBASE) $(LFREL)
55 endif
57 ##### search paths #####
58 vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
60 ##### implicit rules #####
61 $(OBJDIR)/%.o : %.c
62 $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
63 $(CC) $(CFLAGS) -o $@ $<
65 ##### explicit rules #####
66 $(BINARY) : $(OBJECTS)
67 $(LD) -o $(BINARY) $(LFLAGS) $(OBJECTS) $(USRLIBS) $(SYSLIBS)
68 chmod +x $(BINARY)
70 ##### phony #####
71 .PHONY : clean rel dbg
73 clean :
74 @rm -f $(BINDIR)/$(BINNAME) $(OBJDIR)/*.o $(OBJDIR)/*.d
76 rel : $(BINARY)
77 dbg : $(BINARY)
79 ##### dependencies #####
80 -include $(DEPENDS)