Makefile.in 7.2 KB

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