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