diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 23 |
1 files changed, 5 insertions, 18 deletions
@@ -1,5 +1,6 @@ | |||
1 | CC?=gcc | 1 | CC?=gcc |
2 | FEATURES=#-DWANT_CLOSED_TRACKER -DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR | 2 | FEATURES=#-DWANT_CLOSED_TRACKER -DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR |
3 | FEATURES=-DWANT_IP_FROM_QUERY_STRING | ||
3 | OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage | 4 | OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage |
4 | OPTS_production=-s -Os | 5 | OPTS_production=-s -Os |
5 | CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-pedantic #-ansi | 6 | CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-pedantic #-ansi |
@@ -14,24 +15,10 @@ all: $(BINARY) $(BINARY).debug | |||
14 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) | 15 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) |
15 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) | 16 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) |
16 | 17 | ||
17 | OBJECTS_debug = $(SOURCES:%.c=%.debug.o) | ||
18 | OBJECTS_production = $(SOURCES:%.c=%.production.o) | ||
19 | |||
20 | $(OBJECTS_debug) $(OBJECTS_production): $(HEADERS) | ||
21 | |||
22 | %.production.o : CFLAGS := $(CFLAGS_production) | ||
23 | %.debug.o : CFLAGS := $(CFLAGS_debug) | ||
24 | |||
25 | %.production.o : %.c | ||
26 | $(COMPILE.c) $(OUTPUT_OPTION) $< | ||
27 | %.debug.o : %.c | ||
28 | $(COMPILE.c) $(OUTPUT_OPTION) $< | ||
29 | |||
30 | $(BINARY): $(OBJECTS_production) | 18 | $(BINARY): $(OBJECTS_production) |
31 | $(CC) $^ -o $@ $(CFLAGS_production) $(LDFLAGS) | 19 | $(CC) $? -o $@ $(SOURCES) $(CFLAGS_production) $(LDFLAGS) |
32 | $(BINARY).debug: $(OBJECTS_debug) | 20 | $(BINARY).debug: $(OBJECTS_debug) |
33 | $(CC) $^ -o $@ $(CFLAGS_debug) $(LDFLAGS) | 21 | $(CC) $? -o $@ $(SOURCES) $(CFLAGS_debug) $(LDFLAGS) |
34 | |||
35 | clean: | ||
36 | rm -rf opentracker *.o *~ | ||
37 | 22 | ||
23 | clean: | ||
24 | rm -rf opentracker opentracker.debug *.o *~ | ||