diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 29 |
1 files changed, 19 insertions, 10 deletions
| @@ -68,22 +68,25 @@ CFLAGS+=-I$(LIBOWFAT_HEADERS) -DGIT_VERSION=$(GIT_VERSION) -Wall -pipe -pthread | |||
| 68 | LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread | 68 | LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread |
| 69 | 69 | ||
| 70 | BINARY =opentracker | 70 | BINARY =opentracker |
| 71 | HEADERS=trackerlogic.h scan_urlencoded_query.h ot_buf.h ot_hex.h ot_ip.h ot_scan.h ot_mutex.h ot_random.h ot_stats.h ot_vector.h ot_clean.h ot_udp.h ot_iovec.h ot_fullscrape.h ot_accesslist.h ot_http.h ot_livesync.h ot_rijndael.h | 71 | HEADERS=trackerlogic.h scan_urlencoded_query.h ot_buf.h ot_hex.h ot_ip.h ot_scan.h ot_socket.h ot_mutex.h ot_random.h ot_stats.h ot_vector.h ot_clean.h ot_udp.h ot_iovec.h ot_fullscrape.h ot_accesslist.h ot_http.h ot_livesync.h ot_rijndael.h |
| 72 | SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_buf.c ot_hex.c ot_ip.c ot_scan.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 | 72 | SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_buf.c ot_hex.c ot_ip.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 |
| 73 | SOURCES_proxy=proxy.c ot_vector.c ot_mutex.c ot_random.c ot_scan.c ot_ip.c | 73 | SOURCES_proxy=proxy.c ot_vector.c ot_mutex.c ot_random.c ot_scan.c ot_ip.c ot_socket.c |
| 74 | 74 | ||
| 75 | OBJECTS = $(SOURCES:%.c=%.o) | 75 | OBJECTS = $(SOURCES:%.c=%.o) |
| 76 | OBJECTS_debug = $(SOURCES:%.c=%.debug.o) | 76 | OBJECTS_debug = $(SOURCES:%.c=%.debug.o) |
| 77 | OBJECTS_proxy = $(SOURCES_proxy:%.c=%.o) | 77 | OBJECTS_proxy = $(SOURCES_proxy:%.c=%.proxy.o) |
| 78 | OBJECTS_proxy_debug = $(SOURCES_proxy:%.c=%.debug.o) | 78 | OBJECTS_proxy_debug = $(SOURCES_proxy:%.c=%.proxy.debug.o) |
| 79 | 79 | ||
| 80 | .SUFFIXES: .debug.o .o .c | 80 | .SUFFIXES: .proxy.debug.o .proxy.o .debug.o .o .c |
| 81 | 81 | ||
| 82 | all: $(BINARY) $(BINARY).debug | 82 | all: $(BINARY) $(BINARY).debug |
| 83 | 83 | ||
| 84 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) | 84 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) |
| 85 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) | 85 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) |
| 86 | 86 | ||
| 87 | CFLAGS_proxy = $(CFLAGS_production) -DWANT_SYNC_LIVE | ||
| 88 | CFLAGS_proxy_debug = $(CFLAGS_debug) -DWANT_SYNC_LIVE | ||
| 89 | |||
| 87 | $(BINARY): $(OBJECTS) $(HEADERS) | 90 | $(BINARY): $(OBJECTS) $(HEADERS) |
| 88 | $(CC) -o $@ $(OBJECTS) $(LDFLAGS) | 91 | $(CC) -o $@ $(OBJECTS) $(LDFLAGS) |
| 89 | $(STRIP) $@ | 92 | $(STRIP) $@ |
| @@ -94,6 +97,12 @@ proxy: $(OBJECTS_proxy) $(HEADERS) | |||
| 94 | proxy.debug: $(OBJECTS_proxy_debug) $(HEADERS) | 97 | proxy.debug: $(OBJECTS_proxy_debug) $(HEADERS) |
| 95 | $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS) | 98 | $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS) |
| 96 | 99 | ||
| 100 | .c.proxy.debug.o : $(HEADERS) | ||
| 101 | $(CC) -c -o $@ $(CFLAGS_proxy_debug) $(<:.proxy.debug.o=.c) | ||
| 102 | |||
| 103 | .c.proxy.o : $(HEADERS) | ||
| 104 | $(CC) -c -o $@ $(CFLAGS_proxy) $(<:.proxy.o=.c) | ||
| 105 | |||
| 97 | .c.debug.o : $(HEADERS) | 106 | .c.debug.o : $(HEADERS) |
| 98 | $(CC) -c -o $@ $(CFLAGS_debug) $(<:.debug.o=.c) | 107 | $(CC) -c -o $@ $(CFLAGS_debug) $(<:.debug.o=.c) |
| 99 | 108 | ||
| @@ -105,12 +114,12 @@ proxy.debug: $(OBJECTS_proxy_debug) $(HEADERS) | |||
| 105 | # has to. tests/stubs.c supplies the few symbols those modules reference but | 114 | # has to. tests/stubs.c supplies the few symbols those modules reference but |
| 106 | # the tests never reach. | 115 | # the tests never reach. |
| 107 | TESTBIN=tests/runner | 116 | TESTBIN=tests/runner |
| 108 | TEST_SOURCES=tests/runner.c tests/test.c tests/stubs.c tests/t_scan_urlencoded_query.c tests/t_iovec.c tests/t_vector.c tests/t_random.c tests/t_hex.c tests/t_accesslist.c tests/t_scan.c tests/t_buf.c tests/t_ip.c | 117 | TEST_SOURCES=tests/runner.c tests/test.c tests/stubs.c tests/t_scan_urlencoded_query.c tests/t_iovec.c tests/t_vector.c tests/t_random.c tests/t_hex.c tests/t_accesslist.c tests/t_scan.c tests/t_buf.c tests/t_ip.c tests/t_socket.c |
| 109 | TEST_UNITS=scan_urlencoded_query.c ot_buf.c ot_ip.c ot_iovec.c ot_vector.c ot_random.c ot_hex.c ot_scan.c ot_accesslist.c | 118 | TEST_UNITS=scan_urlencoded_query.c ot_buf.c ot_ip.c ot_socket.c ot_iovec.c ot_vector.c ot_random.c ot_hex.c ot_scan.c ot_accesslist.c |
| 110 | TEST_HEADERS=tests/test.h $(HEADERS) | 119 | TEST_HEADERS=tests/test.h $(HEADERS) |
| 111 | # Tests reach code that sits behind feature flags, so the units under test are | 120 | # Tests reach code that sits behind feature flags, so the units under test are |
| 112 | # built with those features enabled. A test binary is not a production binary. | 121 | # built with those features enabled. A test binary is not a production binary. |
| 113 | FEATURES_test=$(FEATURES) -DWANT_ACCESSLIST_BLACK | 122 | FEATURES_test=$(FEATURES) -DWANT_ACCESSLIST_BLACK -DWANT_SYNC_LIVE |
| 114 | CFLAGS_test = $(CFLAGS) -I. -g -O1 $(FEATURES_test) | 123 | CFLAGS_test = $(CFLAGS) -I. -g -O1 $(FEATURES_test) |
| 115 | 124 | ||
| 116 | $(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) | 125 | $(TESTBIN): $(TEST_SOURCES) $(TEST_UNITS) $(TEST_HEADERS) |
| @@ -122,7 +131,7 @@ check: $(TESTBIN) | |||
| 122 | .PHONY: all check clean install | 131 | .PHONY: all check clean install |
| 123 | 132 | ||
| 124 | clean: | 133 | clean: |
| 125 | rm -rf opentracker opentracker.debug $(TESTBIN) *.o *~ | 134 | rm -rf opentracker opentracker.debug proxy proxy.debug $(TESTBIN) *.o *~ |
| 126 | 135 | ||
| 127 | install: | 136 | install: |
| 128 | install -m 755 opentracker $(DESTDIR)$(BINDIR) | 137 | install -m 755 opentracker $(DESTDIR)$(BINDIR) |
