3 INCDIR = ../liblfds600/inc
4 LIBDIR = ../liblfds600/bin
11 ##### sources, objects and libraries #####
13 BINARY = $(BINDIR)/$(BINNAME)
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
20 ##### CPU variants #####
21 GCCARCH = $(shell uname -m)
23 ifeq ($(GCCARCH),x86_64)
27 ifeq ($(findstring arm,$(GCCARCH)),arm)
36 DGFLAGS = -MM -std=c99 -I"$(SRCDIR)" -I"$(INCDIR)"
39 CFBASE = -Wall -Wno-unknown-pragmas -std=c99 -march=$(GCCARCH) -c -I"$(SRCDIR)" -I"$(INCDIR)"
40 CFREL = -O2 -Wno-strict-aliasing
44 LFBASE = -L"$(LIBDIR)"
49 CFLAGS = $(CFBASE) $(CFDBG)
50 LFLAGS = $(LFBASE) $(LFDBG)
52 ifeq ($(MAKECMDGOALS),rel)
53 CFLAGS = $(CFBASE) $(CFREL)
54 LFLAGS = $(LFBASE) $(LFREL)
57 ##### search paths #####
58 vpath %.c $(patsubst %,$(SRCDIR)/%:,$(SRCDIRS))
60 ##### implicit rules #####
62 $(DG) $(DGFLAGS) $< >$(OBJDIR)/$*.d
63 $(CC) $(CFLAGS) -o $@ $<
65 ##### explicit rules #####
66 $(BINARY) : $(OBJECTS)
67 $(LD) -o $(BINARY) $(LFLAGS) $(OBJECTS) $(USRLIBS) $(SYSLIBS)
71 .PHONY : clean rel dbg
74 @rm -f $(BINDIR)/$(BINNAME) $(OBJDIR)/*.o $(OBJDIR)/*.d
79 ##### dependencies #####