Makefile.in 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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 = @CXX@
  27. LD = @CXX@
  28. CC = @CC@
  29. LD_DEBUG = @CXX@
  30. STRIP = @STRIP@
  31. DIFF = @DIFF@
  32. #LIBS = @LIBS@ @ZLIB@
  33. LIBS = @LIBS@
  34. INCLUDES = @TCL_INCLUDES@ @SSL_INCLUDES@
  35. DEBCXXFLAGS = -DDEBUG -fno-inline -g3 -ggdb3 -Wshadow -Wpointer-arith @GCC3DEB@ @GCC4DEB@ @DEBCXXFLAGS@
  36. CFLGS = @GCC3_CFLAGS@
  37. CXXFLAGS = @CXXFLAGS@ $(CFLGS) @GCC3_CXXFLAGS@ -fno-rtti
  38. MAKEFLAGS = -s
  39. STRINGFIX = src/stringfix
  40. MAKE_STATIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX) @STATIC@' 'CC=$(CC) @STATIC@' 'LD=$(LD) @STATIC@' 'INCLUDES=$(INCLUDES)' \
  41. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  42. 'STRIP=$(STRIP)' 'CXXFLAGS=$(CXXFLAGS)' 'CFLGS=$(CFLGS) -DBIN_TYPE_STATIC' 'STRINGFIX=$(STRINGFIX)' \
  43. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
  44. MAKE_DYNAMIC = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'CC=$(CC)' 'LD=$(LD)' 'INCLUDES=$(INCLUDES)' \
  45. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  46. 'STRIP=$(STRIP)' 'CXXFLAGS=$(CXXFLAGS)' 'CFLGS=$(CFLGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=$(STRINGFIX)' \
  47. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(wraith)'
  48. MAKE_DEBUG = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'CC=$(CC)' 'LD=$(LD_DEBUG) -g' 'INCLUDES=$(INCLUDES)' \
  49. 'CCDEPMODE=$(CCDEPMODE)' 'BRANCH=$(BRANCH)' 'COMMIT=$(COMMIT_SHORT)' 'BUILDTS=$(BUILDTS)' 'VERSION=$(VERSION)' \
  50. 'STRIP=touch' 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS) -DBIN_TYPE_DYNAMIC' 'STRINGFIX=' \
  51. 'LIBS=$(LIBS)' 'EGGEXEC=$(BINEXEC)' 'EGGBUILD=(debug)'
  52. MAKE_UTILS = $(MAKE) 'MAKE=$(MAKE)' 'CXX=$(CXX)' 'CC=$(CC)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
  53. 'CCDEPMODE=$(CCDEPMODE)' \
  54. 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD_DEBUG) -g'
  55. MAKE_UTILS_NR = $(MAKE) 'CXX=$(CXX)' 'CC=$(CC)' 'STRIP=touch' 'INCLUDES=$(INCLUDES)' \
  56. 'CCDEPMODE=$(CCDEPMODE)' \
  57. 'CXXFLAGS=$(CXXFLAGS) $(DEBCXXFLAGS)' 'CFLGS=$(CFLGS) $(DEBCXXFLAGS)' 'LIBS=$(LIBS)' 'LD=$(LD) -g'
  58. MAKE_CONFIG = $(MAKE) 'MAKE=$(MAKE)'
  59. .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
  60. all: dynamic
  61. test:
  62. cleanutils:
  63. @rm -f $(STRINGFIX) src/sorthelp@EXEEXT@ src/makehelp@EXEEXT@ src/makeres@EXEEXT@ src/makeset@EXEEXT@
  64. clean: cleanutils
  65. +@cd src && $(MAKE) clean
  66. +@cd src/compat && $(MAKE) clean
  67. +@cd src/crypto && $(MAKE) clean
  68. +@cd src/mod && $(MAKE) clean
  69. -+@cd lib && $(MAKE) clean
  70. @rm -f $(BINEXEC) build/stamp.* *~ src/*~ configure.temp .mangled stamp.*
  71. @rm -f src/help.h src/response.h src/responses.h utctime@EXEEXT@ ts@EXEEXT@
  72. distclean: clean
  73. @rm -rf *-$(VERSION)/ autom4te.cache/ autoscan.log configure.scan
  74. @rm -rf src/.deps/ src/compat/.deps/ src/strucutres/.deps/ src/mod/*.mod/.deps/ src/crypto/.deps src/.defs/
  75. -+@cd lib && $(MAKE) distclean
  76. @rm -f $(STATICMAKEFILES) $(CONFIGFILES) config.h config.log config.status config.cache
  77. distrib: clean
  78. @rm -rf $(DISTRIB)/
  79. -+@cd lib && $(MAKE) distclean
  80. @mkdir $(DISTRIB) && cp -R $(DISTROFILES) $(DISTRIB)
  81. @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`
  82. @rm -rf `find $(DISTRIB)/ \( -name '.git' -o -name '.deps' \) -type d -print`
  83. @for s in $(EXCLUDES); do \
  84. rm -rf $(DISTRIB)/$$s; \
  85. done;
  86. @sed \
  87. -e 's/^COMMIT_FULL .*/COMMIT_FULL = $(COMMIT_FULL)/' \
  88. -e 's/^COMMIT_SHORT .*/COMMIT_SHORT = $(COMMIT_SHORT)/' \
  89. -e 's/^BRANCH .*/BRANCH = $(BRANCH)/' \
  90. -e 's/^BUILDTS .*/BUILDTS = $(BUILDTS)/' \
  91. -e 's/^VERSION .*/VERSION = $(VERSION)/' \
  92. $(DISTRIB)/Makefile.in > Makefile.in.tmp && mv Makefile.in.tmp $(DISTRIB)/Makefile.in
  93. @sed -e 's/GIT_REQUIRED=1/GIT_REQUIRED=0/' configure > $(DISTRIB)/configure
  94. # @for s in `find $(DISTRIB)/src/ -name '*.h' -or -name '*.c'`; do mangle -rnw $$s > /dev/null 2>&1; done
  95. tags:
  96. @which cscope >/dev/null 2>&1 && cscope -Rbq || :
  97. @which ctags >/dev/null 2>&1 && ctags -R || :
  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
  119. @src/makehelp@EXEEXT@ $(HELPFILE) src/help.h~
  120. @(if [ ! -f src/help.h ]; then \
  121. touch src/help.h; \
  122. fi)
  123. @(if test "x`$(DIFF) -qurN src/help.h~ src/help.h`" != "x"; then \
  124. cp -f src/help.h~ src/help.h; \
  125. fi)
  126. set: makeset
  127. @src/makeset@EXEEXT@ $(SETTINGSFILE) src/set_default.h~
  128. @(if [ ! -f src/set_default.h ]; then \
  129. touch src/set_default.h; \
  130. fi)
  131. @(if test "x`$(DIFF) -qurN src/set_default.h~ src/set_default.h`" != "x"; then \
  132. cp -f src/set_default.h~ src/set_default.h; \
  133. fi)
  134. res: makeres
  135. @src/makeres@EXEEXT@ $(RESPONSESFILE) src/ 1
  136. @(if [ ! -f src/response.h ]; then \
  137. touch src/response.h; \
  138. fi)
  139. @(if [ ! -f src/responses.h ]; then \
  140. touch src/responses.h; \
  141. fi)
  142. @(if test "x`$(DIFF) -qurN src/response.h~ src/response.h`" != "x"; then \
  143. cp -f src/response.h~ src/response.h; \
  144. fi)
  145. @(if test "x`$(DIFF) -qurN src/responses.h~ src/responses.h`" != "x"; then \
  146. cp -f src/responses.h~ src/responses.h; \
  147. fi)
  148. stringfix: src/stringfix.cc src/config.h
  149. +@cd src && ${MAKE_UTILS} stringfix
  150. makeres: src/makeres.cc
  151. +@cd src && ${MAKE_UTILS} makeres
  152. makeset: src/makeset.cc
  153. +@cd src && ${MAKE_UTILS} makeset
  154. makehelp: src/makehelp.cc
  155. +@cd src && ${MAKE_UTILS} makehelp
  156. sorthelp: src/sorthelp.cc
  157. +@cd src && ${MAKE_UTILS} sorthelp
  158. utils: stringfix makehelp
  159. crypto:
  160. +@cd src/crypto && ${MAKE_UTILS} crypto
  161. general: help res set stringfix
  162. .NOTPARALLEL: checkclean.static checkclean.dynamic checkclean.debug
  163. checkclean.static:
  164. @(if test -f build/stamp.dynamic -o -f build/stamp.debug; then \
  165. echo "[*] Cleaning up alternate build"; \
  166. $(MAKE) MAKEFLAGS=-s clean; \
  167. fi)
  168. @touch build/stamp.static
  169. checkclean.dynamic:
  170. @(if test -f build/stamp.static -o -f build/stamp.debug; then \
  171. echo "[*] Cleaning up alternate build"; \
  172. $(MAKE) MAKEFLAGS=-s clean; \
  173. fi)
  174. @touch build/stamp.dynamic
  175. checkclean.debug:
  176. @(if test -f build/stamp.static -o -f build/stamp.dynamic; then \
  177. echo "[*] Cleaning up alternate build"; \
  178. $(MAKE) MAKEFLAGS=-s clean; \
  179. fi)
  180. @touch build/stamp.debug
  181. lib:
  182. +@cd lib && $(MAKE)
  183. dynamic: checkclean.dynamic lib general
  184. @echo ""
  185. @echo "Making dynamic binary"
  186. @echo ""
  187. @echo ""
  188. +@cd src/mod && $(MAKE_DYNAMIC) static
  189. +@cd src && $(MAKE_DYNAMIC) $(BINEXEC)
  190. @echo ""
  191. static: checkclean.static lib general
  192. @echo ""
  193. @echo "Making static binary"
  194. @echo ""
  195. @echo ""
  196. +@cd src/mod && $(MAKE_STATIC) static
  197. +@cd src && $(MAKE_STATIC) $(BINEXEC)
  198. @echo ""
  199. dwraith: debug
  200. lib.debug:
  201. +@cd lib && $(MAKE) debug
  202. debug: checkclean.debug lib.debug general
  203. @echo ""
  204. @echo "Making debug binary"
  205. @echo ""
  206. @echo ""
  207. +@cd src/mod && $(MAKE_DEBUG) static
  208. +@cd src && $(MAKE_DEBUG) $(BINEXEC)
  209. @echo ""
  210. #safety hash