An open and free bittorrent tracker https://erdgeist.org/gitweb/opentracker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

88 lines
2.5 KiB

  1. # $Id: Makefile,v 1.74 2018/01/29 17:45:20 erdgeist Exp $
  2. CC?=gcc
  3. # Linux flavour
  4. # PREFIX?=/opt/diet
  5. # LIBOWFAT_HEADERS=$(PREFIX)/include
  6. # LIBOWFAT_LIBRARY=$(PREFIX)/lib
  7. # BSD flavour
  8. # PREFIX?=/usr/local
  9. # LIBOWFAT_HEADERS=$(PREFIX)/include/libowfat
  10. # LIBOWFAT_LIBRARY=$(PREFIX)/lib
  11. # Debug flavour
  12. PREFIX?=..
  13. LIBOWFAT_HEADERS=$(PREFIX)/libowfat
  14. LIBOWFAT_LIBRARY=$(PREFIX)/libowfat
  15. BINDIR?=$(PREFIX)/bin
  16. #FEATURES+=-DWANT_V6
  17. #FEATURES+=-DWANT_ACCESSLIST_BLACK
  18. #FEATURES+=-DWANT_ACCESSLIST_WHITE
  19. #FEATURES+=-DWANT_SYNC_LIVE
  20. #FEATURES+=-DWANT_IP_FROM_QUERY_STRING
  21. #FEATURES+=-DWANT_COMPRESSION_GZIP
  22. #FEATURES+=-DWANT_COMPRESSION_GZIP_ALWAYS
  23. #FEATURES+=-DWANT_LOG_NETWORKS
  24. #FEATURES+=-DWANT_RESTRICT_STATS
  25. #FEATURES+=-DWANT_IP_FROM_PROXY
  26. #FEATURES+=-DWANT_FULLLOG_NETWORKS
  27. #FEATURES+=-DWANT_LOG_NUMWANT
  28. #FEATURES+=-DWANT_MODEST_FULLSCRAPES
  29. #FEATURES+=-DWANT_SPOT_WOODPECKER
  30. #FEATURES+=-DWANT_SYSLOGS
  31. #FEATURES+=-DWANT_DEV_RANDOM
  32. FEATURES+=-DWANT_FULLSCRAPE
  33. #FEATURES+=-D_DEBUG_HTTPERROR
  34. OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage
  35. OPTS_production=-O3
  36. CFLAGS+=-I$(LIBOWFAT_HEADERS) -Wall -pipe -Wextra #-ansi -pedantic
  37. LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread -lpthread -lz
  38. BINARY =opentracker
  39. HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.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
  40. SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_mutex.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
  41. SOURCES_proxy=proxy.c ot_vector.c ot_mutex.c
  42. OBJECTS = $(SOURCES:%.c=%.o)
  43. OBJECTS_debug = $(SOURCES:%.c=%.debug.o)
  44. OBJECTS_proxy = $(SOURCES_proxy:%.c=%.o)
  45. OBJECTS_proxy_debug = $(SOURCES_proxy:%.c=%.debug.o)
  46. .SUFFIXES: .debug.o .o .c
  47. all: $(BINARY) $(BINARY).debug
  48. CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES)
  49. CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES)
  50. $(BINARY): $(OBJECTS) $(HEADERS)
  51. $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
  52. strip $@
  53. $(BINARY).debug: $(OBJECTS_debug) $(HEADERS)
  54. $(CC) -o $@ $(OBJECTS_debug) $(LDFLAGS)
  55. proxy: $(OBJECTS_proxy) $(HEADERS)
  56. $(CC) -o $@ $(OBJECTS_proxy) $(CFLAGS_production) $(LDFLAGS)
  57. proxy.debug: $(OBJECTS_proxy_debug) $(HEADERS)
  58. $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS)
  59. .c.debug.o : $(HEADERS)
  60. $(CC) -c -o $@ $(CFLAGS_debug) $(<:.debug.o=.c)
  61. .c.o : $(HEADERS)
  62. $(CC) -c -o $@ $(CFLAGS_production) $<
  63. clean:
  64. rm -rf opentracker opentracker.debug *.o *~
  65. install:
  66. install -m 755 opentracker $(BINDIR)