diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -1,23 +1,33 @@ | |||
1 | CC?=gcc | 1 | CC?=gcc |
2 | FEATURES=-DWANT_TRACKER_SYNC #-DWANT_CLOSED_TRACKER -DWANT_UTORRENT1600_WORKAROUND #-DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR -DWANT_TRACKER_SYNC | 2 | FEATURES=#-DWANT_CLOSED_TRACKER -DWANT_UTORRENT1600_WORKAROUND -DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR -DWANT_TRACKER_SYNC |
3 | OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage | 3 | OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage |
4 | OPTS_production=-s -Os | 4 | OPTS_production=-Os |
5 | CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-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 | BINARY = opentracker |
9 | HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_sync.h ot_vector.h ot_clean.h | 9 | HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_sync.h ot_vector.h ot_clean.h |
10 | SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_mutex.c ot_stats.c ot_sync.c ot_vector.c ot_clean.c | 10 | SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_mutex.c ot_stats.c ot_sync.c ot_vector.c ot_clean.c |
11 | 11 | ||
12 | OBJECTS = $(SOURCES:%.c=%.o) | ||
13 | OBJECTS_debug = $(SOURCES:%.c=%.debug.o) | ||
14 | |||
12 | all: $(BINARY) $(BINARY).debug | 15 | all: $(BINARY) $(BINARY).debug |
13 | 16 | ||
14 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) | 17 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) |
15 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) | 18 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) |
16 | 19 | ||
17 | $(BINARY): $(SOURCES) $(HEADERS) | 20 | $(BINARY): $(OBJECTS) |
18 | $(CC) -o $@ $(SOURCES) $(CFLAGS_production) $(LDFLAGS) | 21 | $(CC) -o $@ $(OBJECTS) $(LDFLAGS) |
19 | $(BINARY).debug: $(SOURCES) $(HEADERS) | 22 | strip $@ |
20 | $(CC) -o $@ $(SOURCES) $(CFLAGS_debug) $(LDFLAGS) | 23 | $(BINARY).debug: $(OBJECTS_debug) $(HEADERS) |
21 | 24 | $(CC) -o $@ $(OBJECTS_debug) $(LDFLAGS) | |
25 | |||
26 | %.debug.o : %.c $(HEADERS) | ||
27 | $(CC) -c -o $@ $(CFLAGS_debug) $< | ||
28 | |||
29 | %.o : %.c $(HEADERS) | ||
30 | $(CC) -c -o $@ $(CFLAGS_production) $< | ||
31 | |||
22 | clean: | 32 | clean: |
23 | rm -rf opentracker opentracker.debug *.o *~ | 33 | rm -rf opentracker opentracker.debug *.o *~ |