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