summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--Makefile40
2 files changed, 16 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index 8b4bec1..b5c40f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,10 @@
1*.o 1*.o
2*.dSYM
3opentracker
4opentracker.debug
5opentracker.integration
6opentracker.tsan
7proxy
8proxy.debug
2tests/runner 9tests/runner
10tests/runner.sanitize
diff --git a/Makefile b/Makefile
index 1a8912b..f79d6a6 100644
--- a/Makefile
+++ b/Makefile
@@ -73,13 +73,6 @@ HEADERS=trackerlogic.h ot_urlencoded.h ot_batch.h ot_buf.h ot_event.h ot_fdstate
73SOURCES=opentracker.c trackerlogic.c ot_urlencoded.c ot_batch.c ot_buf.c ot_event.c ot_fdstate.c ot_fmt.c ot_hex.c ot_ip.c ot_config.c ot_scan.c ot_socket.c ot_mutex.c ot_random.c ot_stats.c ot_vector.c ot_clean.c ot_udp.c ot_iovec.c ot_fullscrape.c ot_accesslist.c ot_http.c ot_livesync.c ot_rijndael.c 73SOURCES=opentracker.c trackerlogic.c ot_urlencoded.c ot_batch.c ot_buf.c ot_event.c ot_fdstate.c ot_fmt.c ot_hex.c ot_ip.c ot_config.c ot_scan.c ot_socket.c ot_mutex.c ot_random.c ot_stats.c ot_vector.c ot_clean.c ot_udp.c ot_iovec.c ot_fullscrape.c ot_accesslist.c ot_http.c ot_livesync.c ot_rijndael.c
74SOURCES_proxy=proxy.c ot_batch.c ot_fdstate.c ot_vector.c ot_mutex.c ot_random.c ot_scan.c ot_ip.c ot_socket.c 74SOURCES_proxy=proxy.c ot_batch.c ot_fdstate.c ot_vector.c ot_mutex.c ot_random.c ot_scan.c ot_ip.c ot_socket.c
75 75
76OBJECTS = $(SOURCES:%.c=%.o)
77OBJECTS_debug = $(SOURCES:%.c=%.debug.o)
78OBJECTS_proxy = $(SOURCES_proxy:%.c=%.proxy.o)
79OBJECTS_proxy_debug = $(SOURCES_proxy:%.c=%.proxy.debug.o)
80
81.SUFFIXES: .proxy.debug.o .proxy.o .debug.o .o .c
82
83all: $(BINARY) $(BINARY).debug 76all: $(BINARY) $(BINARY).debug
84 77
85CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) 78CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES)
@@ -88,32 +81,15 @@ CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES)
88CFLAGS_proxy = $(CFLAGS_production) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE 81CFLAGS_proxy = $(CFLAGS_production) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE
89CFLAGS_proxy_debug = $(CFLAGS_debug) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE 82CFLAGS_proxy_debug = $(CFLAGS_debug) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE
90 83
91$(BINARY): $(OBJECTS) 84$(BINARY): $(SOURCES) $(HEADERS)
92 $(CC) -o $@ $(OBJECTS) $(LDFLAGS) 85 $(CC) -o $@ $(CFLAGS_production) $(SOURCES) $(LDFLAGS)
93 $(STRIP) $@ 86 $(STRIP) $@
94$(BINARY).debug: $(OBJECTS_debug) 87$(BINARY).debug: $(SOURCES) $(HEADERS)
95 $(CC) -o $@ $(OBJECTS_debug) $(LDFLAGS) 88 $(CC) -o $@ $(CFLAGS_debug) $(SOURCES) $(LDFLAGS)
96proxy: $(OBJECTS_proxy) 89proxy: $(SOURCES_proxy) $(HEADERS)
97 $(CC) -o $@ $(OBJECTS_proxy) $(CFLAGS_production) $(LDFLAGS) $(LDFLAGS_libowfat) 90 $(CC) -o $@ $(CFLAGS_proxy) $(SOURCES_proxy) $(LDFLAGS) $(LDFLAGS_libowfat)
98proxy.debug: $(OBJECTS_proxy_debug) 91proxy.debug: $(SOURCES_proxy) $(HEADERS)
99 $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS) $(LDFLAGS_libowfat) 92 $(CC) -o $@ $(CFLAGS_proxy_debug) $(SOURCES_proxy) $(LDFLAGS) $(LDFLAGS_libowfat)
100
101$(OBJECTS): $(HEADERS)
102$(OBJECTS_debug): $(HEADERS)
103$(OBJECTS_proxy): $(HEADERS)
104$(OBJECTS_proxy_debug): $(HEADERS)
105
106.c.proxy.debug.o :
107 $(CC) -c -o $@ $(CFLAGS_proxy_debug) $(<:.proxy.debug.o=.c)
108
109.c.proxy.o :
110 $(CC) -c -o $@ $(CFLAGS_proxy) $(<:.proxy.o=.c)
111
112.c.debug.o :
113 $(CC) -c -o $@ $(CFLAGS_debug) $(<:.debug.o=.c)
114
115.c.o :
116 $(CC) -c -o $@ $(CFLAGS_production) $<
117 93
118# Unit tests. The modules under test are compiled straight into the test 94# Unit tests. The modules under test are compiled straight into the test
119# binary, so a test may reach a static function by including the source if it 95# binary, so a test may reach a static function by including the source if it