Makefile.in 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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 = build/config.cache build/config.log build/config.status src/config.h src/buildinfo.h
  14. DISTROFILES = README.md LICENSE build 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. CXX_DEBUG = @CCACHE@ @DISTCC@ @CXX@
  30. LD_DEBUG = @CXX@
  31. STRIP = @STRIP@
  32. DIFF = @DIFF@
  33. #LIBS = @LIBS@ @ZLIB@
  34. LIBS = @LIBS@
  35. INCLUDES = @TCL_INCLUDES@
  36. DEBCXXFLAGS = -DDEBUG -fno-inline -g3 -ggdb3 -O0 -Wshadow -Wpointer-arith -Wcast-align @GCC3DEB@ @GCC4DEB@ @DEBCXXFLAGS@
  37. CFLGS = @GCC3_CFLAGS@ @SSL_INCLUDES@
  38. CXXFLAGS = @CXXFLAGS@ $(CFLGS) @GCC3_CXXFLAGS@ -fno-rtti
  39. MAKEFLAGS = -s
  40. STRINGFIX = src/stringfix
  41. MAKE_STATIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD_STATIC)' 'INCLUDES=$(INCLUDES)' \
  42. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  43. 'STRIP=$(STRIP)' 'CXXFLAGS=$(CXXFLAGS)' 'CFLGS=$(CFLGS) -DBIN_TYPE_STATIC' 'STRINGFIX=$(STRINGFIX)' \
  44. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
  45. MAKE_DYNAMIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'LD=$(LD_DYNAMIC)' 'INCLUDES=$(INCLUDES)' \
  46. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  47. 'STRIP=$(STRIP)' 'CXXFLAGS=$(CXXFLAGS)' 'CFLGS=$(CFLGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=$(STRINGFIX)' \
  48. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
  49. MAKE_DEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX_DEBUG)' 'LD=$(LD_DEBUG) -g' 'INCLUDES=$(INCLUDES)' \
  50. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  51. 'STRIP=touch' 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=' \
  52. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(debug)'
  53. MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX_DEBUG)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
  54. 'CCDEPMODE=$(CCDEPMODE)' \
  55. 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD_DEBUG) -g'
  56. MAKE_UTILS_NR = $(MAKE) 'CXX=$(CXX)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
  57. 'CCDEPMODE=$(CCDEPMODE)' \
  58. 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD) -g'
  59. MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'
  60. .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 tags
  61. all: dynamic
  62. test:
  63. cleanutils:
  64. @rm -f $(STRINGFIX) src/sorthelp@EXEEXT@ src/makehelp@EXEEXT@ src/makeres@EXEEXT@ src/makeset@EXEEXT@
  65. clean: cleanutils
  66. +@cd src && $(MAKE) clean
  67. +@cd src/compat && $(MAKE) clean
  68. +@cd src/crypto && $(MAKE) clean
  69. +@cd src/mod && $(MAKE) clean
  70. -+@cd lib && $(MAKE) clean
  71. @rm -f $(BINEXEC) build/stamp.* *~ src/*~ configure.temp .mangled stamp.*
  72. @rm -f src/help.h src/response.h src/responses.h utctime@EXEEXT@ ts@EXEEXT@
  73. distclean: clean
  74. @rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan
  75. @rm -rf src/.deps/ src/compat/.deps/ src/strucutres/.deps/ src/mod/*.mod/.deps/ src/crypto/.deps src/.defs/
  76. -+@cd lib && $(MAKE) distclean
  77. @rm -f $(STATICMAKEFILES) $(CONFIGFILES) config.h config.log config.status config.cache
  78. distrib: clean
  79. @rm -rf $(DISTRIB)/
  80. -+@cd lib && $(MAKE) distclean
  81. @mkdir $(DISTRIB) && cp -R $(DISTROFILES) $(DISTRIB)
  82. @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`
  83. @rm -rf `find $(DISTRIB)/ \( -name '.git' -o -name '.deps' \) -type d -print`
  84. @for s in $(EXCLUDES); do \
  85. rm -rf $(DISTRIB)/$$s; \
  86. done;
  87. @sed \
  88. -e 's/^COMMIT_FULL .*/COMMIT_FULL = $(COMMIT_FULL)/' \
  89. -e 's/^COMMIT_SHORT .*/COMMIT_SHORT = $(COMMIT_SHORT)/' \
  90. -e 's/^BRANCH .*/BRANCH = $(BRANCH)/' \
  91. -e 's/^BUILDTS .*/BUILDTS = $(BUILDTS)/' \
  92. -e 's/^VERSION .*/VERSION = $(VERSION)/' \
  93. $(DISTRIB)/Makefile.in > Makefile.in.tmp && mv Makefile.in.tmp $(DISTRIB)/Makefile.in
  94. @sed -e 's/GIT_REQUIRED=1/GIT_REQUIRED=0/' configure > $(DISTRIB)/configure
  95. # @for s in `find $(DISTRIB)/src/ -name '*.h' -or -name '*.c'`; do mangle -rnw $$s > /dev/null 2>&1; done
  96. tags:
  97. @which cscope >/dev/null 2>&1 && cscope -Rbq || :
  98. @which ctags >/dev/null 2>&1 && ctags -R || :
  99. tar: distrib
  100. tar -czvf $(DISTRIB).tar.gz $(DISTRIB)/
  101. ls -al $(DISTRIB).tar.gz
  102. # rm -rf $(DISTRIB)/
  103. # cd ../ && rm -rf distrib/
  104. indent:
  105. @ifiles="`find src -name '*.h' -or -name '*.c'`"; \
  106. for s in $$ifiles; \
  107. do \
  108. INDENT_PROFILE=private/indent.pro indent $$s; \
  109. done
  110. sort: sorthelp
  111. @(if test "x`tail -n 1 $(HELPFILE)`" != "x::end"; then \
  112. echo "::end" >> $(HELPFILE); \
  113. fi)
  114. # @(sed $(HELPFILE) -e "s/^$$/ /" > help~ && mv -f help~ $(HELPFILE)) || rm -f help~
  115. @(sed -r -e :a -e 's/^$$/ /' -e '$$!N;s/^ \n:/:/;ta' -e 'P;D' $(HELPFILE) > help~ && mv -f help~ $(HELPFILE)) || rm -f help~
  116. @cp -f $(HELPFILE) help.txt~
  117. @(src/sorthelp@EXEEXT@ $(HELPFILE) $(HELPFILE) || (cp -f help.txt~ $(HELPFILE); echo "Sort failed, restoring backup."))
  118. @rm -f help.txt~
  119. help: makehelp
  120. @src/makehelp@EXEEXT@ $(HELPFILE) src/help.h~
  121. @(if [ ! -f src/help.h ]; then \
  122. touch src/help.h; \
  123. fi)
  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.cc src/config.h
  150. +@cd src && ${MAKE_UTILS} stringfix
  151. makeres: src/makeres.cc
  152. +@cd src && ${MAKE_UTILS} makeres
  153. makeset: src/makeset.cc
  154. +@cd src && ${MAKE_UTILS} makeset
  155. makehelp: src/makehelp.cc
  156. +@cd src && ${MAKE_UTILS} makehelp
  157. sorthelp: src/sorthelp.cc
  158. +@cd src && ${MAKE_UTILS} sorthelp
  159. utils: stringfix makehelp
  160. crypto:
  161. +@cd src/crypto && ${MAKE_UTILS} crypto
  162. general: help res set stringfix
  163. .NOTPARALLEL: checkclean.static checkclean.dynamic checkclean.debug
  164. checkclean.static:
  165. @(if test -f build/stamp.dynamic -o -f build/stamp.debug; then \
  166. echo "[*] Cleaning up alternate build"; \
  167. $(MAKE) MAKEFLAGS=-s clean; \
  168. fi)
  169. @touch build/stamp.static
  170. checkclean.dynamic:
  171. @(if test -f build/stamp.static -o -f build/stamp.debug; then \
  172. echo "[*] Cleaning up alternate build"; \
  173. $(MAKE) MAKEFLAGS=-s clean; \
  174. fi)
  175. @touch build/stamp.dynamic
  176. checkclean.debug:
  177. @(if test -f build/stamp.static -o -f build/stamp.dynamic; then \
  178. echo "[*] Cleaning up alternate build"; \
  179. $(MAKE) MAKEFLAGS=-s clean; \
  180. fi)
  181. @touch build/stamp.debug
  182. lib:
  183. +@cd lib && $(MAKE)
  184. dynamic: checkclean.dynamic lib general
  185. @echo ""
  186. @echo "Making dynamic binary"
  187. @echo ""
  188. @echo ""
  189. +@cd src/mod && $(MAKE_DYNAMIC) static
  190. +@cd src && $(MAKE_DYNAMIC) $(BINEXEC)
  191. @echo ""
  192. static: checkclean.static lib general
  193. @echo ""
  194. @echo "Making static binary"
  195. @echo ""
  196. @echo ""
  197. +@cd src/mod && $(MAKE_STATIC) static
  198. +@cd src && $(MAKE_STATIC) $(BINEXEC)
  199. @echo ""
  200. dwraith: debug
  201. lib.debug:
  202. +@cd lib && $(MAKE) debug
  203. debug: checkclean.debug lib.debug general
  204. @echo ""
  205. @echo "Making debug binary"
  206. @echo ""
  207. @echo ""
  208. +@cd src/mod && $(MAKE_DEBUG) static
  209. +@cd src && $(MAKE_DEBUG) $(BINEXEC)
  210. @echo ""
  211. #safety hash