Makefile.in 8.5 KB

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