Merge from emacs-23; up to 2010-06-08T03:06:47Z!dann@ics.uci.edu.
[emacs.git] / lib / makefile.w32-in
blobb2aececf251b57f6e67a1a0cf2239720268a1724
1 # -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2 # Copyright (C) 2011 Free Software Foundation, Inc.
4 # This file is part of GNU Emacs.
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.
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.
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/>.
19 ALL = gnulib
21 .PHONY: $(ALL)
23 LOCAL_FLAGS     = -DHAVE_CONFIG_H=1 -I. -I../nt/inc -I../src
24 LIBS            =
26 GNULIBOBJS = $(BLD)/dtoastr.$(O) \
27              $(BLD)/getopt.$(O)  \
28              $(BLD)/getopt1.$(O) \
29              $(BLD)/strftime.$(O) \
30              $(BLD)/time_r.$(O) \
31              $(BLD)/md5.$(O) \
32              $(BLD)/filemode.$(O)
35 # Build the library
37 $(BLD)/libgnu.$(A):     $(GNULIBOBJS)
38         - $(DEL) $@
39         $(AR) $(AR_OUT)$@ $(ALL_DEPS)
41 gnulib: stamp_BLD $(BLD)/libgnu.$(A)
44 # Build everything
46 all:            stamp_BLD $(ALL)
48 ### TAGS ###
50 TAGS:
51          ../lib-src/$(BLD)/etags.exe *.c *.h
53 ### DEPENDENCIES ###
55 EMACS_ROOT      = ..
56 SRC             = .
58 $(BLD)/dtoastr.$(O) : \
59         $(SRC)/dtoastr.c \
60         $(SRC)/ftoastr.c \
61         $(SRC)/ftoastr.h \
62         $(SRC)/intprops.h \
63         $(EMACS_ROOT)/nt/inc/sys/stat.h \
64         $(EMACS_ROOT)/src/s/ms-w32.h \
65         $(EMACS_ROOT)/src/m/intel386.h \
66         $(EMACS_ROOT)/src/config.h
68 $(BLD)/getopt.$(O) : \
69         $(SRC)/getopt.c \
70         $(SRC)/getopt.h \
71         $(SRC)/getopt_int.h \
72         $(SRC)/gettext.h \
73         $(EMACS_ROOT)/nt/inc/unistd.h \
74         $(EMACS_ROOT)/nt/inc/sys/stat.h \
75         $(EMACS_ROOT)/src/s/ms-w32.h \
76         $(EMACS_ROOT)/src/m/intel386.h \
77         $(EMACS_ROOT)/src/config.h
79 $(BLD)/getopt1.$(O) : \
80         $(SRC)/getopt1.c \
81         $(SRC)/getopt.h \
82         $(SRC)/getopt_int.h \
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
88 $(BLD)/strftime.$(O) : \
89         $(SRC)/strftime.c \
90         $(SRC)/strftime.h \
91         $(EMACS_ROOT)/nt/inc/stdbool.h \
92         $(EMACS_ROOT)/nt/inc/sys/stat.h \
93         $(EMACS_ROOT)/src/s/ms-w32.h \
94         $(EMACS_ROOT)/src/m/intel386.h \
95         $(EMACS_ROOT)/src/config.h
97 $(BLD)/time_r.$(O) : \
98         $(SRC)/time_r.c \
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
104 $(BLD)/md5.$(O) : \
105         $(SRC)/md5.c \
106         $(SRC)/md5.h \
107         $(EMACS_ROOT)/nt/inc/stdint.h \
108         $(EMACS_ROOT)/nt/inc/sys/stat.h \
109         $(EMACS_ROOT)/src/s/ms-w32.h \
110         $(EMACS_ROOT)/src/m/intel386.h \
111         $(EMACS_ROOT)/src/config.h
113 $(BLD)/filemode.$(O) : \
114         $(SRC)/filemode.c \
115         $(SRC)/filemode.h \
116         $(EMACS_ROOT)/nt/inc/sys/stat.h \
117         $(EMACS_ROOT)/src/s/ms-w32.h \
118         $(EMACS_ROOT)/src/m/intel386.h \
119         $(EMACS_ROOT)/src/config.h
121 # The following dependencies are for supporting parallel builds, where
122 # we must make sure $(BLD) exists before any compilation starts.
124 $(BLD)/dtoastr.$(O) $(BLD)/getopt.$(O) $(BLD)/getopt1.$(O): stamp_BLD
125 $(BLD)/strftime.$(O) $(BLD)/time_r.$(O) $(BLD)/md5.$(O): stamp_BLD
126 $(BLD)/filemode.$(O): stamp_BLD
129 # Headers we would preprocess if we could.
131 getopt.h:       getopt_.h
132         $(CP) $(ALL_DEPS) $@
135 # Maintenance
137 clean:
138         - $(DEL) $(COMPILER_TEMP_FILES)
139         - $(DEL) getopt.h
140         - $(DEL_TREE) $(OBJDIR)
141         - $(DEL) stamp_BLD
143 distclean:      cleanall
144         - $(DEL) TAGS
145         - $(DEL) Makefile
147 maintainer-clean: distclean
148         - $(DEL) getopt_.h
150 cleanall:       clean
151         - $(DEL_TREE) obj
152         - $(DEL_TREE) obj-spd
153         - $(DEL_TREE) oo
154         - $(DEL_TREE) oo-spd
156 # A dummy target to force other targets to be evaluated.
157 doit:
159 getopt_.h: getopt.in.h $(ARG_NONNULL_H)
160         $(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
162 getopt_.h-CMD: doit
163         @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
164         @echo Run "$(MAKETYPE) getopt_h" in the lib/ subdirectory.
165         @echo You will need GNU Sed to be installed.
166         exit -1
168 getopt_.h-SH: doit
169         @echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
170         @echo Run '"$(MAKETYPE) getopt_h"' in the lib/ subdirectory.
171         @echo You will need GNU Sed to be installed.
172         exit -1
174 # Generating getopt_.h from getopt.in.h.
176 # To avoid requiring all end users to install Sed, we have below
177 # a maintainer-only target that produces getopt_.h from getopt.in.h.
178 # For easier maintenance, all the strings that replace the @FOO@
179 # placeholder are defined as Make macros below.
181 HAVE_GETOPT_H = HAVE_GETOPT_H
182 INCLUDE_NEXT = include_next
183 PRAGMA_SYSTEM_HEADER = \#pragma GCC system_header
184 PRAGMA_COLUMNS =
185 NEXT_GETOPT_H = <getopt.h>
186 ARG_NONNULL_H = ../arg-nonnull.h
188 getopt_h:
189         - $(DEL) getopt_.h-t getopt_.h
190         sed -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \
191             -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \
192             -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \
193             -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \
194             -e "s!@NEXT_GETOPT_H@!$(NEXT_GETOPT_H)!g" \
195             -e "/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)" \
196             -e "/^\# include_next/i # ifndef __GNUC__" \
197             -e "/^\# include_next/i # include <next_getopt.h>" \
198             -e "/^\# include_next/i # else" \
199             -e "/^\# include_next/a # endif" \
200               < getopt.in.h > getopt_.h-t
201         $(CP) getopt_.h-t getopt_.h
202         - $(DEL) getopt_.h-t