Makefile.in 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. #
  2. # DO NOT EDIT THIS FILE
  3. #
  4. #
  5. SHELL = @SHELL@
  6. top_srcdir = @top_srcdir@
  7. srcdir = @srcdir@
  8. VPATH = @srcdir@
  9. @SET_MAKE@
  10. CCDEPMODE = @CCDEPMODE@
  11. BINEXEC = wraith@EXEEXT@
  12. STATICMAKEFILES = lib/Makefile src/mod/Makefile src/crypto/Makefile src/compat/Makefile src/Makefile Makefile
  13. CONFIGFILES = config.cache config.log config.status config.h src/buildinfo.h
  14. DISTROFILES = README LICENSE config.h.in autotools doc scripts lib Makefile.in build.sh configure src BSDmakefile
  15. EXCLUDES = $(CONFIGFILES) $(STATICMAKEFILES)
  16. COMMIT_FULL := $(shell git log -1 --pretty=format:%H HEAD)
  17. COMMIT_SHORT := $(shell git log -1 --pretty=format:%h HEAD)
  18. BRANCH := $(shell git branch --no-color | grep "^*" | sed -e 's/^\* //')
  19. BUILDTS := $(shell git log -1 --pretty=format:%ct HEAD)
  20. VERSION := $(shell git describe)
  21. DISTRIB = wraith-$(VERSION)
  22. HELPFILE = doc/help.txt
  23. SETTINGSFILE = doc/settings.txt
  24. RESPONSESFILE = doc/responses.txt
  25. # defaults
  26. CXX = @CCACHE@ @DISTCC@ @CXX@ @STATIC@
  27. LD_DYNAMIC = @CXX@
  28. LD_STATIC = @CXX@ @STATIC@
  29. CCDEBUG = @CCACHE@ @DISTCC@ @CXX@
  30. LD_DEBUG = @CXX@
  31. STRIP = @STRIP@
  32. DIFF = @DIFF@
  33. #LIBS = @LIBS@ @ZLIB@
  34. LIBS = @LIBS@ @SSL_LIBS@
  35. DEBCXXFLAGS = -DDEBUG -fno-inline -g3 -ggdb3 -O0 -Wshadow -Wpointer-arith -Wcast-align @GCC3DEB@ @GCC4DEB@
  36. CFLGS = @GCC3@ -fno-rtti @SSL_INCLUDES@
  37. _CFLGS = -fno-strict-aliasing -W -Wformat \
  38. #-Wshadow -Wnested-externs -Wno-format-y2k \
  39. #-Wlarger-than-6608 -Wpointer-arith -Wcast-align \
  40. #-Waggrepate-return -Wbad-function-cast \
  41. #-Wlong-long @GCC3@
  42. #-Wmissing-noreturn
  43. #-Wunused-parameter
  44. #-Wwrite-strings
  45. #-Wconversion
  46. #-Wtraditional
  47. MAKEFLAGS = -s @MAKEJOBS@
  48. MAKE_STATIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD_STATIC)' \
  49. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  50. 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DBIN_TYPE_STATIC' \
  51. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
  52. MAKE_DYNAMIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD_DYNAMIC)' \
  53. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  54. 'STRIP=$(STRIP)' 'CFLGS=$(CFLGS) -DBIN_TYPE_DYNAMIC' \
  55. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
  56. MAKE_DEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'LD=$(LD_DEBUG) -g' \
  57. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  58. 'STRIP=touch' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS) -DBIN_TYPE_DYNAMIC' \
  59. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(debug)'
  60. MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CCDEBUG)' 'STRIP=touch' \
  61. 'CCDEPMODE=$(CCDEPMODE)' \
  62. 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD_DEBUG) -g'
  63. MAKE_UTILS_NR = $(MAKE) 'CXX=$(CXX)' 'STRIP=touch' \
  64. 'CCDEPMODE=$(CCDEPMODE)' \
  65. 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD) -g'
  66. MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'
  67. .PHONY: checkclean.static checkclean.dynamic checkclean.debug lib wraith dwraith lib.debug debug test general crypto utils sorthelp makehelp makeset makeres stringfix set res help sort indent tar distrib distclean clean cleanutils test all dynamic static
  68. all: dynamic
  69. test:
  70. cleanutils:
  71. @rm -f src/stringfix@EXEEXT@ src/sorthelp@EXEEXT@ src/makehelp@EXEEXT@ src/makeres@EXEEXT@ src/makeset@EXEEXT@
  72. clean: cleanutils
  73. +@cd src && $(MAKE) clean
  74. +@cd src/compat && $(MAKE) clean
  75. +@cd src/crypto && $(MAKE) clean
  76. +@cd src/mod && $(MAKE) distclean
  77. -+@cd lib && $(MAKE) clean
  78. @rm -f $(BINEXEC) stamp.* *~ src/*~ configure.temp .mangled
  79. @rm -f src/help.h src/response.h src/responses.h utctime@EXEEXT@ ts@EXEEXT@
  80. distclean: clean
  81. @rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan
  82. @rm -rf src/.deps/ src/compat/.deps/ src/strucutres/.deps/ src/mod/*.mod/.deps/ src/crypto/.deps
  83. -+@cd lib && $(MAKE) distclean
  84. @rm -f $(STATICMAKEFILES) $(CONFIGFILES)
  85. distrib: clean
  86. @rm -rf $(DISTRIB)/
  87. -+@cd lib && $(MAKE) distclean
  88. @mkdir $(DISTRIB) && cp -r $(DISTROFILES) $(DISTRIB)
  89. @rm -rf `find $(DISTRIB)/ \( -name '*~' -o -name '*#' -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' -o -name '.gitignore' -o -name '.*.swp' \) -type f -print`
  90. @rm -rf `find $(DISTRIB)/ \( -name '.git' -o -name '.deps' \) -type d -print`
  91. @for s in $(EXCLUDES); do \
  92. rm -rf $(DISTRIB)/$$s; \
  93. done;
  94. @sed \
  95. -e 's/^COMMIT_FULL .*/COMMIT_FULL = $(COMMIT_FULL)/' \
  96. -e 's/^COMMIT_SHORT .*/COMMIT_SHORT = $(COMMIT_SHORT)/' \
  97. -e 's/^BRANCH .*/BRANCH = $(BRANCH)/' \
  98. -e 's/^BUILDTS .*/BUILDTS = $(BUILDTS)/' \
  99. -e 's/^VERSION .*/VERSION = $(VERSION)/' \
  100. $(DISTRIB)/Makefile.in > Makefile.in.tmp && mv Makefile.in.tmp $(DISTRIB)/Makefile.in
  101. @sed -e 's/GIT_REQUIRED=1/GIT_REQUIRED=0/' configure > $(DISTRIB)/configure
  102. # @for s in `find $(DISTRIB)/src/ -name '*.h' -or -name '*.c'`; do mangle -rnw $$s > /dev/null 2>&1; done
  103. tar: distrib
  104. tar -czvf $(DISTRIB).tar.gz $(DISTRIB)/
  105. ls -al $(DISTRIB).tar.gz
  106. # rm -rf $(DISTRIB)/
  107. # cd ../ && rm -rf distrib/
  108. indent:
  109. @ifiles="`find src -name '*.h' -or -name '*.c'`"; \
  110. for s in $$ifiles; \
  111. do \
  112. INDENT_PROFILE=private/indent.pro indent $$s; \
  113. done
  114. sort: sorthelp
  115. @(if test "x`tail -n 1 $(HELPFILE)`" != "x::end"; then \
  116. echo "::end" >> $(HELPFILE); \
  117. fi)
  118. # @(sed $(HELPFILE) -e "s/^$$/ /" > help~ && mv -f help~ $(HELPFILE)) || rm -f help~
  119. @(sed -r -e :a -e 's/^$$/ /' -e '$$!N;s/^ \n:/:/;ta' -e 'P;D' $(HELPFILE) > help~ && mv -f help~ $(HELPFILE)) || rm -f help~
  120. @cp -f $(HELPFILE) help.txt~
  121. @(src/sorthelp@EXEEXT@ $(HELPFILE) $(HELPFILE) || (cp -f help.txt~ $(HELPFILE); echo "Sort failed, restoring backup."))
  122. @rm -f help.txt~
  123. help: makehelp stringfix
  124. @src/makehelp@EXEEXT@ $(HELPFILE) src/help.h.tmp~
  125. @(if [ ! -f src/help.h ]; then \
  126. touch src/help.h; \
  127. fi)
  128. @src/stringfix@EXEEXT@ src/help.h.tmp~ src/help.h~ 1
  129. @(if test "x`$(DIFF) -qurN src/help.h~ src/help.h`" != "x"; then \
  130. cp -f src/help.h~ src/help.h; \
  131. fi)
  132. set: makeset
  133. @src/makeset@EXEEXT@ $(SETTINGSFILE) src/set_default.h~
  134. @(if [ ! -f src/set_default.h ]; then \
  135. touch src/set_default.h; \
  136. fi)
  137. @(if test "x`$(DIFF) -qurN src/set_default.h~ src/set_default.h`" != "x"; then \
  138. cp -f src/set_default.h~ src/set_default.h; \
  139. fi)
  140. res: makeres
  141. @src/makeres@EXEEXT@ $(RESPONSESFILE) src/ 1
  142. @(if [ ! -f src/response.h ]; then \
  143. touch src/response.h; \
  144. fi)
  145. @(if [ ! -f src/responses.h ]; then \
  146. touch src/responses.h; \
  147. fi)
  148. @(if test "x`$(DIFF) -qurN src/response.h~ src/response.h`" != "x"; then \
  149. cp -f src/response.h~ src/response.h; \
  150. fi)
  151. @(if test "x`$(DIFF) -qurN src/responses.h~ src/responses.h`" != "x"; then \
  152. cp -f src/responses.h~ src/responses.h; \
  153. fi)
  154. stringfix: src/stringfix.c config.h
  155. +@cd src && ${MAKE_UTILS} stringfix
  156. makeres: src/makeres.c
  157. +@cd src && ${MAKE_UTILS} makeres
  158. makeset: src/makeset.c
  159. +@cd src && ${MAKE_UTILS} makeset
  160. makehelp: src/makehelp.c
  161. +@cd src && ${MAKE_UTILS} makehelp
  162. sorthelp: src/sorthelp.c
  163. +@cd src && ${MAKE_UTILS} sorthelp
  164. utils: stringfix makehelp
  165. crypto:
  166. +@cd src/crypto && ${MAKE_UTILS} crypto
  167. general: help res set
  168. .NOTPARALLEL: checkclean.static checkclean.dynamic checkclean.debug
  169. checkclean.static:
  170. @(if test -f stamp.dynamic -o -f stamp.debug; then \
  171. echo "[*] Cleaning up alternate build"; \
  172. $(MAKE) MAKEFLAGS=-s clean; \
  173. fi)
  174. @touch stamp.static
  175. checkclean.dynamic:
  176. @(if test -f stamp.static -o -f stamp.debug; then \
  177. echo "[*] Cleaning up alternate build"; \
  178. $(MAKE) MAKEFLAGS=-s clean; \
  179. fi)
  180. @touch stamp.dynamic
  181. checkclean.debug:
  182. @(if test -f stamp.static -o -f stamp.dynamic; then \
  183. echo "[*] Cleaning up alternate build"; \
  184. $(MAKE) MAKEFLAGS=-s clean; \
  185. fi)
  186. @touch stamp.debug
  187. lib:
  188. +@cd lib && $(MAKE)
  189. dynamic: checkclean.dynamic lib general
  190. @echo ""
  191. @echo "Making dynamic binary"
  192. @echo ""
  193. @echo ""
  194. +@cd src/mod && $(MAKE_DYNAMIC) static
  195. +@cd src && $(MAKE_DYNAMIC) $(BINEXEC)
  196. @echo ""
  197. static: checkclean.static lib general
  198. @echo ""
  199. @echo "Making static binary"
  200. @echo ""
  201. @echo ""
  202. +@cd src/mod && $(MAKE_STATIC) static
  203. +@cd src && $(MAKE_STATIC) $(BINEXEC)
  204. @echo ""
  205. dwraith: debug
  206. lib.debug:
  207. +@cd lib && $(MAKE) debug
  208. debug: checkclean.debug lib.debug general
  209. @echo ""
  210. @echo "Making debug binary"
  211. @echo ""
  212. @echo ""
  213. +@cd src/mod && $(MAKE_DEBUG) static
  214. +@cd src && $(MAKE_DEBUG) $(BINEXEC)
  215. @echo ""
  216. #safety hash