Commit | Line | Data |
---|---|---|
f915f0f7 EZ |
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 | ||
70b0d280 EZ |
26 | GNULIBOBJS = $(BLD)/dtoastr.$(O) \ |
27 | $(BLD)/getopt.$(O) \ | |
28 | $(BLD)/getopt1.$(O) \ | |
29 | $(BLD)/strftime.$(O) \ | |
32159fc3 CS |
30 | $(BLD)/time_r.$(O) \ |
31 | $(BLD)/md5.$(O) | |
f915f0f7 EZ |
32 | |
33 | # | |
34 | # Build the library | |
35 | # | |
36 | $(BLD)/libgnu.$(A): $(GNULIBOBJS) | |
37 | - $(DEL) $@ | |
38 | $(AR) $(AR_OUT)$@ $(ALL_DEPS) | |
39 | ||
40 | gnulib: stamp_BLD $(BLD)/libgnu.$(A) | |
41 | ||
42 | # | |
43 | # Build everything | |
44 | # | |
45 | all: stamp_BLD $(ALL) | |
46 | ||
47 | ### TAGS ### | |
48 | ||
49 | TAGS: | |
50 | ../lib-src/$(BLD)/etags.exe *.c *.h | |
51 | ||
52 | ### DEPENDENCIES ### | |
53 | ||
54 | EMACS_ROOT = .. | |
55 | SRC = . | |
56 | ||
57 | $(BLD)/dtoastr.$(O) : \ | |
58 | $(SRC)/dtoastr.c \ | |
59 | $(SRC)/ftoastr.c \ | |
60 | $(SRC)/ftoastr.h \ | |
61 | $(SRC)/intprops.h \ | |
70b0d280 EZ |
62 | $(EMACS_ROOT)/src/s/ms-w32.h \ |
63 | $(EMACS_ROOT)/src/m/intel386.h \ | |
f915f0f7 EZ |
64 | $(EMACS_ROOT)/src/config.h |
65 | ||
66 | $(BLD)/getopt.$(O) : \ | |
67 | $(SRC)/getopt.c \ | |
68 | $(SRC)/getopt.h \ | |
69 | $(SRC)/getopt_int.h \ | |
70 | $(EMACS_ROOT)/src/s/ms-w32.h \ | |
71 | $(EMACS_ROOT)/src/m/intel386.h \ | |
72 | $(EMACS_ROOT)/src/config.h | |
73 | ||
74 | $(BLD)/getopt1.$(O) : \ | |
75 | $(SRC)/getopt1.c \ | |
76 | $(SRC)/getopt.h \ | |
77 | $(SRC)/getopt_int.h \ | |
78 | $(EMACS_ROOT)/src/s/ms-w32.h \ | |
79 | $(EMACS_ROOT)/src/m/intel386.h \ | |
80 | $(EMACS_ROOT)/src/config.h | |
81 | ||
70b0d280 EZ |
82 | $(BLD)/strftime.$(O) : \ |
83 | $(SRC)/strftime.c \ | |
84 | $(SRC)/strftime.h \ | |
85 | $(EMACS_ROOT)/nt/inc/stdbool.h \ | |
86 | $(EMACS_ROOT)/src/s/ms-w32.h \ | |
87 | $(EMACS_ROOT)/src/m/intel386.h \ | |
88 | $(EMACS_ROOT)/src/config.h | |
89 | ||
90 | $(BLD)/time_r.$(O) : \ | |
91 | $(SRC)/time_r.c \ | |
92 | $(EMACS_ROOT)/nt/inc/stdbool.h \ | |
93 | $(EMACS_ROOT)/src/s/ms-w32.h \ | |
94 | $(EMACS_ROOT)/src/m/intel386.h \ | |
95 | $(EMACS_ROOT)/src/config.h | |
96 | ||
32159fc3 CS |
97 | $(BLD)/md5.$(O) : \ |
98 | $(EMACS_ROOT)/lib/md5.c \ | |
99 | $(EMACS_ROOT)/src/s/ms-w32.h \ | |
100 | $(EMACS_ROOT)/src/m/intel386.h \ | |
101 | $(EMACS_ROOT)/src/config.h \ | |
32159fc3 CS |
102 | $(EMACS_ROOT)/lib/md5.h |
103 | ||
f915f0f7 EZ |
104 | # The following dependencies are for supporting parallel builds, where |
105 | # we must make sure $(BLD) exists before any compilation starts. | |
106 | # | |
107 | $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD | |
32159fc3 | 108 | $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD |
f915f0f7 EZ |
109 | |
110 | # | |
111 | # Headers we would preprocess if we could. | |
112 | # | |
113 | getopt.h: getopt_.h | |
114 | $(CP) $(ALL_DEPS) $@ | |
115 | ||
116 | # | |
117 | # Maintenance | |
118 | # | |
119 | clean: | |
120 | - $(DEL) $(COMPILER_TEMP_FILES) | |
121 | - $(DEL) getopt.h | |
122 | - $(DEL_TREE) $(OBJDIR) | |
123 | - $(DEL) stamp_BLD | |
124 | ||
125 | distclean: cleanall | |
126 | - $(DEL) TAGS | |
127 | - $(DEL) Makefile | |
128 | ||
129 | maintainer-clean: distclean | |
130 | - $(DEL) getopt_.h | |
131 | ||
132 | cleanall: clean | |
133 | - $(DEL_TREE) obj | |
134 | - $(DEL_TREE) obj-spd | |
135 | - $(DEL_TREE) oo | |
136 | - $(DEL_TREE) oo-spd | |
137 | ||
138 | # A dummy target to force other targets to be evaluated. | |
139 | doit: | |
140 | ||
141 | getopt_.h: getopt.in.h $(ARG_NONNULL_H) | |
142 | $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE) | |
143 | ||
144 | getopt_.h-CMD: doit | |
145 | @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h. | |
146 | @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory. | |
147 | @echo You will need GNU Sed to be installed. | |
148 | exit -1 | |
149 | ||
150 | getopt_.h-SH: doit | |
151 | @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h. | |
152 | @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory. | |
153 | @echo You will need GNU Sed to be installed. | |
154 | exit -1 | |
155 | ||
156 | # Generating getopt_.h from getopt.in.h. | |
157 | # | |
158 | # To avoid requiring all end users to install Sed, we have below | |
159 | # a maintainer-only target that produces getopt_.h from getopt.in.h. | |
160 | # For easier maintenance, all the strings that replace the @FOO@ | |
161 | # placeholder are defined as Make macros below. | |
162 | ||
163 | HAVE_GETOPT_H = HAVE_GETOPT_H | |
164 | INCLUDE_NEXT = include_next | |
165 | PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header | |
166 | PRAGMA_COLUMNS = | |
167 | NEXT_GETOPT_H = <getopt.h> | |
168 | ARG_NONNULL_H = ../arg-nonnull.h | |
169 | ||
170 | getopt_h: | |
171 | - $(DEL) getopt_.h-t getopt_.h | |
172 | sed -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \ | |
173 | -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \ | |
174 | -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \ | |
175 | -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \ | |
176 | -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \ | |
177 | -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \ | |
178 | -e "/^\# include_next/i # ifndef __GNUC__" \ | |
179 | -e "/^\# include_next/i # include <next_getopt.h>" \ | |
180 | -e "/^\# include_next/i # else" \ | |
181 | -e "/^\# include_next/a # endif" \ | |
182 | < getopt.in.h > getopt_.h-t | |
183 | $(CP) getopt_.h-t getopt_.h | |
184 | - $(DEL) getopt_.h-t |