diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 40 |
1 files changed, 12 insertions, 28 deletions
| @@ -1,20 +1,6 @@ | |||
| 1 | # $Id$ | 1 | # $Id$ |
| 2 | 2 | ||
| 3 | # Linux flavour | ||
| 4 | # PREFIX?=/opt/diet | ||
| 5 | # LIBOWFAT_HEADERS=$(PREFIX)/include | ||
| 6 | # LIBOWFAT_LIBRARY=$(PREFIX)/lib | ||
| 7 | |||
| 8 | # BSD flavour | ||
| 9 | # PREFIX?=/usr/local | ||
| 10 | # LIBOWFAT_HEADERS=$(PREFIX)/include/libowfat | ||
| 11 | # LIBOWFAT_LIBRARY=$(PREFIX)/lib | ||
| 12 | |||
| 13 | # Debug flavour | ||
| 14 | PREFIX?=.. | 3 | PREFIX?=.. |
| 15 | LIBOWFAT_HEADERS=$(PREFIX)/libowfat | ||
| 16 | LIBOWFAT_LIBRARY=$(PREFIX)/libowfat | ||
| 17 | |||
| 18 | BINDIR?=$(PREFIX)/bin | 4 | BINDIR?=$(PREFIX)/bin |
| 19 | STRIP?=strip | 5 | STRIP?=strip |
| 20 | 6 | ||
| @@ -62,11 +48,6 @@ OPTS_production=-O3 | |||
| 62 | CFLAGS+=-DOT_VERSION=\"$(VERSION)\" -DGIT_VERSION=\"$(GIT_VERSION)\" -Wall -pipe -pthread -Wextra -Wwrite-strings #-ansi -pedantic | 48 | CFLAGS+=-DOT_VERSION=\"$(VERSION)\" -DGIT_VERSION=\"$(GIT_VERSION)\" -Wall -pipe -pthread -Wextra -Wwrite-strings #-ansi -pedantic |
| 63 | LDFLAGS+=-pthread | 49 | LDFLAGS+=-pthread |
| 64 | 50 | ||
| 65 | # Only the proxy, which has not been ported since the tracker went dual stack, | ||
| 66 | # still wants libowfat. | ||
| 67 | CFLAGS_libowfat=-I$(LIBOWFAT_HEADERS) | ||
| 68 | LDFLAGS_libowfat=-L$(LIBOWFAT_LIBRARY) -lowfat | ||
| 69 | |||
| 70 | # Record feature flags as a dep to allow rebuild when they change | 51 | # Record feature flags as a dep to allow rebuild when they change |
| 71 | BUILDSTAMP=.buildstamp | 52 | BUILDSTAMP=.buildstamp |
| 72 | BUILDDEPS=Makefile $(BUILDSTAMP) | 53 | BUILDDEPS=Makefile $(BUILDSTAMP) |
| @@ -79,25 +60,28 @@ FORCE: | |||
| 79 | BINARY =opentracker | 60 | BINARY =opentracker |
| 80 | HEADERS=trackerlogic.h ot_urlencoded.h ot_batch.h ot_buf.h ot_event.h ot_fdstate.h ot_fmt.h ot_hex.h ot_ip.h ot_config.h ot_scan.h ot_socket.h ot_tcp.h ot_worker.h ot_workqueue.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 | 61 | HEADERS=trackerlogic.h ot_urlencoded.h ot_batch.h ot_buf.h ot_event.h ot_fdstate.h ot_fmt.h ot_hex.h ot_ip.h ot_config.h ot_scan.h ot_socket.h ot_tcp.h ot_worker.h ot_workqueue.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 |
| 81 | SOURCES=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_tcp.c ot_worker.c ot_workqueue.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 | 62 | SOURCES=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_tcp.c ot_worker.c ot_workqueue.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 |
| 82 | SOURCES_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 | ||
| 83 | 63 | ||
| 84 | all: $(BINARY) $(BINARY).debug | 64 | all: $(BINARY) $(BINARY).debug |
| 85 | 65 | ||
| 86 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) | 66 | CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) |
| 87 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) | 67 | CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) |
| 88 | 68 | ||
| 89 | CFLAGS_proxy = $(CFLAGS_production) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE | ||
| 90 | CFLAGS_proxy_debug = $(CFLAGS_debug) $(CFLAGS_libowfat) -DWANT_SYNC_LIVE | ||
| 91 | |||
| 92 | $(BINARY): $(SOURCES) $(HEADERS) $(BUILDDEPS) | 69 | $(BINARY): $(SOURCES) $(HEADERS) $(BUILDDEPS) |
| 93 | $(CC) -o $@ $(CFLAGS_production) $(SOURCES) $(LDFLAGS) | 70 | $(CC) -o $@ $(CFLAGS_production) $(SOURCES) $(LDFLAGS) |
| 94 | $(STRIP) $@ | 71 | $(STRIP) $@ |
| 95 | $(BINARY).debug: $(SOURCES) $(HEADERS) $(BUILDDEPS) | 72 | $(BINARY).debug: $(SOURCES) $(HEADERS) $(BUILDDEPS) |
| 96 | $(CC) -o $@ $(CFLAGS_debug) $(SOURCES) $(LDFLAGS) | 73 | $(CC) -o $@ $(CFLAGS_debug) $(SOURCES) $(LDFLAGS) |
| 97 | proxy: $(SOURCES_proxy) $(HEADERS) $(BUILDDEPS) | 74 | |
| 98 | $(CC) -o $@ $(CFLAGS_proxy) $(SOURCES_proxy) $(LDFLAGS) $(LDFLAGS_libowfat) | 75 | # The proxy is out of service |
| 99 | proxy.debug: $(SOURCES_proxy) $(HEADERS) $(BUILDDEPS) | 76 | # |
| 100 | $(CC) -o $@ $(CFLAGS_proxy_debug) $(SOURCES_proxy) $(LDFLAGS) $(LDFLAGS_libowfat) | 77 | # SOURCES_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 |
| 78 | # CFLAGS_proxy = $(CFLAGS_production) -DWANT_SYNC_LIVE | ||
| 79 | # CFLAGS_proxy_debug = $(CFLAGS_debug) -DWANT_SYNC_LIVE | ||
| 80 | # | ||
| 81 | # proxy: $(SOURCES_proxy) $(HEADERS) $(BUILDDEPS) | ||
| 82 | # $(CC) -o $@ $(CFLAGS_proxy) $(SOURCES_proxy) $(LDFLAGS) | ||
| 83 | # proxy.debug: $(SOURCES_proxy) $(HEADERS) $(BUILDDEPS) | ||
| 84 | # $(CC) -o $@ $(CFLAGS_proxy_debug) $(SOURCES_proxy) $(LDFLAGS) | ||
| 101 | 85 | ||
| 102 | # Unit tests. The modules under test are compiled straight into the test | 86 | # Unit tests. The modules under test are compiled straight into the test |
| 103 | # binary, so a test may reach a static function by including the source if it | 87 | # binary, so a test may reach a static function by including the source if it |
| @@ -174,7 +158,7 @@ check-all: | |||
| 174 | 158 | ||
| 175 | .PHONY: all FORCE dist check check-poll check-sanitize check-integration check-tsan check-all clean install | 159 | .PHONY: all FORCE dist check check-poll check-sanitize check-integration check-tsan check-all clean install |
| 176 | 160 | ||
| 177 | BINARIES=opentracker opentracker.debug opentracker.integration opentracker.tsan proxy proxy.debug $(TESTBIN) $(TESTBIN).sanitize $(TESTBIN).poll | 161 | BINARIES=opentracker opentracker.debug opentracker.integration opentracker.tsan $(TESTBIN) $(TESTBIN).sanitize $(TESTBIN).poll |
| 178 | 162 | ||
| 179 | clean: | 163 | clean: |
| 180 | rm -rf $(BINARIES) $(BINARIES:=.dSYM) $(BUILDSTAMP) *.o *~ | 164 | rm -rf $(BINARIES) $(BINARIES:=.dSYM) $(BUILDSTAMP) *.o *~ |
