3 INCDIR = ../liblfds611/inc
\r
4 LIBDIR = ../liblfds611/bin
\r
9 QUIETLY = 1>nul 2>nul
\r
11 ##### sources, objects and libraries #####
\r
13 BINARY = $(BINDIR)/$(BINNAME)
\r
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
\r
16 OBJECTS = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(SOURCES)))
\r
17 SYSLIBS = -lpthread -lc -lm
\r
20 ##### CPU variants #####
\r
21 UNAME = $(shell uname -m)
\r
22 GCCARCH = -march=$(UNAME)
\r
24 ifeq ($(UNAME),x86_64)
\r
25 GCCARCH = -march=core2
\r
28 ifeq ($(findstring arm,$(UNAME)),arm)
\r
29 GCCARCH = -march=armv6k -marm
\r
37 DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)"
\r
40 CFBASE = -Wall -Wno-unknown-pragmas -std=c99 $(GCCARCH) -pthread -c -I"$(SRCDIR)" -I"$(INCDIR)"
\r
41 CFREL = -O2 -Wno-strict-aliasing
\r
45 LFBASE = -L"$(LIBDIR)"
\r
49 ##### variants #####
\r
50 CFLAGS = $(CFBASE) $(CFDBG)
\r
51 LFLAGS = $(LFBASE) $(LFDBG)
\r
53 ifeq ($(MAKECMDGOALS),rel)
\r
54 CFLAGS = $(CFBASE) $(CFREL)
\r
55 LFLAGS = $(LFBASE) $(LFREL)
\r
58 ##### search paths #####
\r
59 vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
\r
61 ##### implicit rules #####
\r
63 $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
\r
64 $(CC) $(CFLAGS) -o $@ $<
\r
66 ##### explicit rules #####
\r
67 $(BINARY) : $(OBJECTS)
\r
68 $(LD) -o $(BINARY) $(LFLAGS) $(OBJECTS) $(USRLIBS) $(SYSLIBS)
\r
72 .PHONY : clean rel dbg
\r
75 @rm -f $(BINDIR)/$(BINNAME) $(OBJDIR)/*.o $(OBJDIR)/*.d
\r
80 ##### dependencies #####
\r