summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 31 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index dd5c728..178a8c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,37 @@
1CC?=gcc 1CC?=gcc
2FEATURES=#-DWANT_IP_FROM_QUERY_STRING -DWANT_BLACKLIST -DWANT_CLOSED_TRACKER -D_DEBUG_HTTPERROR 2FEATURES=#-DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR
3#DEBUG_OPTS=-g -ggdb -pg # -fprofile-arcs -ftest-coverage 3OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage
4DEBUG_OPTS=-s -Os 4OPTS_production=-s -Os
5CFLAGS+=-I../libowfat -Wall -pipe# -pedantic -ansi 5CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-pedantic #-ansi
6LDFLAGS+=-L../libowfat/ -lowfat 6LDFLAGS+=-L../libowfat/ -lowfat
7 7
8BINARY = opentracker
8HEADERS=trackerlogic.h scan_urlencoded_query.h 9HEADERS=trackerlogic.h scan_urlencoded_query.h
9SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c 10SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c
11
12all: $(BINARY) $(BINARY).debug
13
14CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES)
15CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES)
16
17OBJECTS_debug = $(SOURCES:%.c=%.debug.o)
18OBJECTS_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
11opentracker: $(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
14clean: 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