makefile.w32-in 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
  2. # Copyright (C) 2011 Free Software Foundation, Inc.
  3. # This file is part of GNU Emacs.
  4. # GNU Emacs is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. # GNU Emacs is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  14. ALL = gnulib
  15. .PHONY: $(ALL)
  16. LOCAL_FLAGS = -DHAVE_CONFIG_H=1 -I. -I../nt/inc -I../src
  17. LIBS =
  18. GNULIBOBJS = $(BLD)/dtoastr.$(O) \
  19. $(BLD)/getopt.$(O) \
  20. $(BLD)/getopt1.$(O) \
  21. $(BLD)/strftime.$(O) \
  22. $(BLD)/time_r.$(O) \
  23. $(BLD)/md5.$(O) \
  24. $(BLD)/sha1.$(O) \
  25. $(BLD)/sha256.$(O) \
  26. $(BLD)/sha512.$(O) \
  27. $(BLD)/filemode.$(O)
  28. #
  29. # Build the library
  30. #
  31. $(BLD)/libgnu.$(A): $(GNULIBOBJS)
  32. - $(DEL) $@
  33. $(AR) $(AR_OUT)$@ $(ALL_DEPS)
  34. gnulib: stamp_BLD $(BLD)/libgnu.$(A)
  35. #
  36. # Build everything
  37. #
  38. all: stamp_BLD $(ALL)
  39. ### TAGS ###
  40. FRC:
  41. TAGS: FRC
  42. ../lib-src/$(BLD)/etags.exe *.c *.h
  43. ### DEPENDENCIES ###
  44. EMACS_ROOT = ..
  45. SRC = .
  46. $(BLD)/dtoastr.$(O) : \
  47. $(SRC)/dtoastr.c \
  48. $(SRC)/ftoastr.c \
  49. $(SRC)/ftoastr.h \
  50. $(SRC)/intprops.h \
  51. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  52. $(EMACS_ROOT)/src/s/ms-w32.h \
  53. $(EMACS_ROOT)/src/m/intel386.h \
  54. $(EMACS_ROOT)/src/config.h
  55. $(BLD)/getopt.$(O) : \
  56. $(SRC)/getopt.c \
  57. $(SRC)/getopt.h \
  58. $(SRC)/getopt_int.h \
  59. $(SRC)/gettext.h \
  60. $(EMACS_ROOT)/nt/inc/unistd.h \
  61. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  62. $(EMACS_ROOT)/src/s/ms-w32.h \
  63. $(EMACS_ROOT)/src/m/intel386.h \
  64. $(EMACS_ROOT)/src/config.h
  65. $(BLD)/getopt1.$(O) : \
  66. $(SRC)/getopt1.c \
  67. $(SRC)/getopt.h \
  68. $(SRC)/getopt_int.h \
  69. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  70. $(EMACS_ROOT)/src/s/ms-w32.h \
  71. $(EMACS_ROOT)/src/m/intel386.h \
  72. $(EMACS_ROOT)/src/config.h
  73. $(BLD)/strftime.$(O) : \
  74. $(SRC)/strftime.c \
  75. $(SRC)/strftime.h \
  76. $(EMACS_ROOT)/nt/inc/stdbool.h \
  77. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  78. $(EMACS_ROOT)/src/s/ms-w32.h \
  79. $(EMACS_ROOT)/src/m/intel386.h \
  80. $(EMACS_ROOT)/src/config.h
  81. $(BLD)/time_r.$(O) : \
  82. $(SRC)/time_r.c \
  83. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  84. $(EMACS_ROOT)/src/s/ms-w32.h \
  85. $(EMACS_ROOT)/src/m/intel386.h \
  86. $(EMACS_ROOT)/src/config.h
  87. $(BLD)/md5.$(O) : \
  88. $(SRC)/md5.c \
  89. $(SRC)/md5.h \
  90. $(EMACS_ROOT)/nt/inc/stdint.h \
  91. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  92. $(EMACS_ROOT)/src/s/ms-w32.h \
  93. $(EMACS_ROOT)/src/m/intel386.h \
  94. $(EMACS_ROOT)/src/config.h
  95. $(BLD)/sha1.$(O) : \
  96. $(SRC)/sha1.c \
  97. $(SRC)/sha1.h \
  98. $(EMACS_ROOT)/nt/inc/stdint.h \
  99. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  100. $(EMACS_ROOT)/src/s/ms-w32.h \
  101. $(EMACS_ROOT)/src/m/intel386.h \
  102. $(EMACS_ROOT)/src/config.h
  103. $(BLD)/sha256.$(O) : \
  104. $(SRC)/sha256.c \
  105. $(SRC)/sha256.h \
  106. $(EMACS_ROOT)/nt/inc/stdint.h \
  107. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  108. $(EMACS_ROOT)/src/s/ms-w32.h \
  109. $(EMACS_ROOT)/src/m/intel386.h \
  110. $(EMACS_ROOT)/src/config.h
  111. $(BLD)/sha512.$(O) : \
  112. $(SRC)/sha512.c \
  113. $(SRC)/sha512.h \
  114. $(EMACS_ROOT)/nt/inc/stdint.h \
  115. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  116. $(EMACS_ROOT)/src/s/ms-w32.h \
  117. $(EMACS_ROOT)/src/m/intel386.h \
  118. $(EMACS_ROOT)/src/config.h
  119. $(BLD)/filemode.$(O) : \
  120. $(SRC)/filemode.c \
  121. $(SRC)/filemode.h \
  122. $(EMACS_ROOT)/nt/inc/sys/stat.h \
  123. $(EMACS_ROOT)/src/s/ms-w32.h \
  124. $(EMACS_ROOT)/src/m/intel386.h \
  125. $(EMACS_ROOT)/src/config.h
  126. # The following dependencies are for supporting parallel builds, where
  127. # we must make sure $(BLD) exists before any compilation starts.
  128. #
  129. $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD
  130. $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD
  131. $(BLD)/sha1.$(O) $(BLD)/sha256.$(O) $(BLD)/sha512.$(O): stamp_BLD
  132. $(BLD)/filemode.$(O): stamp_BLD
  133. #
  134. # Headers we would preprocess if we could.
  135. #
  136. getopt.h: getopt_.h
  137. $(CP) $(ALL_DEPS) $@
  138. #
  139. # Maintenance
  140. #
  141. clean:
  142. - $(DEL) $(COMPILER_TEMP_FILES)
  143. - $(DEL) getopt.h
  144. - $(DEL_TREE) $(OBJDIR)
  145. - $(DEL) stamp_BLD
  146. distclean: cleanall
  147. - $(DEL) TAGS
  148. - $(DEL) Makefile
  149. maintainer-clean: distclean
  150. - $(DEL) getopt_.h
  151. cleanall: clean
  152. - $(DEL_TREE) obj
  153. - $(DEL_TREE) obj-spd
  154. - $(DEL_TREE) oo
  155. - $(DEL_TREE) oo-spd
  156. # A dummy target to force other targets to be evaluated.
  157. doit:
  158. getopt_.h: getopt.in.h $(ARG_NONNULL_H)
  159. $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
  160. getopt_.h-CMD: doit
  161. @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
  162. @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
  163. @echo You will need GNU Sed to be installed.
  164. exit -1
  165. getopt_.h-SH: doit
  166. @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
  167. @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
  168. @echo You will need GNU Sed to be installed.
  169. exit -1
  170. # Generating getopt_.h from getopt.in.h.
  171. #
  172. # To avoid requiring all end users to install Sed, we have below
  173. # a maintainer-only target that produces getopt_.h from getopt.in.h.
  174. # For easier maintenance, all the strings that replace the @FOO@
  175. # placeholder are defined as Make macros below.
  176. HAVE_GETOPT_H = HAVE_GETOPT_H
  177. INCLUDE_NEXT = include_next
  178. PRAGMA_COLUMNS =
  179. NEXT_GETOPT_H = <getopt.h>
  180. ARG_NONNULL_H = ../build-aux/snippet/arg-nonnull.h
  181. getopt_h:
  182. - $(DEL) getopt_.h-t getopt_.h
  183. sed -e "s!@GUARD_PREFIX@!GL!g" \
  184. -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
  185. -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
  186. -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
  187. -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
  188. -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
  189. -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
  190. -e "/^\# include_next/i # ifndef __GNUC__" \
  191. -e "/^\# include_next/i # include <next_getopt.h>" \
  192. -e "/^\# include_next/i # else" \
  193. -e "/^\# include_next/a # endif" \
  194. < getopt.in.h > getopt_.h-t
  195. $(CP) getopt_.h-t getopt_.h
  196. - $(DEL) getopt_.h-t