summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorerdgeist <>2007-11-06 12:44:53 +0000
committererdgeist <>2007-11-06 12:44:53 +0000
commit2e62624bc446ae6413b24fe002faf20e373d7c05 (patch)
tree7e53d8f19f0ab3ef612eb520ffc027bb37307eee /Makefile
parent4ccbc9bd0eae8c604d570ce22654fc79822bd9dc (diff)
Makefile now builds each object on its own. Thus it can be build with -j2 and higher
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 19 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 2360025..ea00d75 100644
--- a/Makefile
+++ b/Makefile
@@ -1,23 +1,33 @@
1CC?=gcc 1CC?=gcc
2FEATURES=-DWANT_TRACKER_SYNC #-DWANT_CLOSED_TRACKER -DWANT_UTORRENT1600_WORKAROUND #-DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR -DWANT_TRACKER_SYNC 2FEATURES=#-DWANT_CLOSED_TRACKER -DWANT_UTORRENT1600_WORKAROUND -DWANT_IP_FROM_QUERY_STRING -D_DEBUG_HTTPERROR -DWANT_TRACKER_SYNC
3OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage 3OPTS_debug=-g -ggdb #-pg # -fprofile-arcs -ftest-coverage
4OPTS_production=-s -Os 4OPTS_production=-Os
5CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-pedantic #-ansi 5CFLAGS+=-I../libowfat -Wall -pipe -Wextra #-pedantic -ansi
6LDFLAGS+=-L../libowfat/ -lowfat 6LDFLAGS+=-L../libowfat/ -lowfat
7 7
8BINARY = opentracker 8BINARY = opentracker
9HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_sync.h ot_vector.h ot_clean.h 9HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_sync.h ot_vector.h ot_clean.h
10SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_mutex.c ot_stats.c ot_sync.c ot_vector.c ot_clean.c 10SOURCES=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
12OBJECTS = $(SOURCES:%.c=%.o)
13OBJECTS_debug = $(SOURCES:%.c=%.debug.o)
14
12all: $(BINARY) $(BINARY).debug 15all: $(BINARY) $(BINARY).debug
13 16
14CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) 17CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES)
15CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) 18CFLAGS_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
22clean: 32clean:
23 rm -rf opentracker opentracker.debug *.o *~ 33 rm -rf opentracker opentracker.debug *.o *~