]> cygwin.com Git - cygwin-apps/setup.git/blob - Makefile.in
2002-04-23 Robert Collins <rbtcollins@hotmail.com>
[cygwin-apps/setup.git] / Makefile.in
1 # Copyright (c) 2000, Red Hat, Inc.
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # A copy of the GNU General Public License can be found at
9 # http://www.gnu.org/
10 #
11 # Written by Christopher Faylor <cgf@redhat.com>
12 #
13 # Makefile for Cygwin installer
14
15 # Memory debugging
16 # MC_OBJS = dlmalloc.o
17 #MC_DEFS = -DDEBUG
18 # Use the below when building production releases
19 #MC_OBJS =
20 #MC_DEFS =
21
22 SHELL := @SHELL@
23
24 srcdir := @srcdir@
25 VPATH := @srcdir@
26 prefix := @prefix@
27 exec_prefix := @exec_prefix@
28
29 bindir := @bindir@
30 etcdir := $(exec_prefix)/etc
31
32 program_transform_name := @program_transform_name@
33
34 INSTALL := @INSTALL@
35 INSTALL_PROGRAM := @INSTALL_PROGRAM@
36 INSTALL_DATA := @INSTALL_DATA@
37
38 EXEEXT := @EXEEXT@
39 EXEEXT_FOR_BUILD := @EXEEXT_FOR_BUILD@
40
41 CC := @CC@
42 CC_FOR_TARGET := $(CC)
43 CXX := @CXX@
44
45 CFLAGS := @CFLAGS@ $(MC_DEFS) -Werror -Winline -Wall -Wpointer-arith \
46 -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
47 -Wmissing-declarations -Wcomments
48 CXXFLAGS := @CXXFLAGS@ $(CFLAGS) -fno-rtti
49 CXX := @CXX@
50
51 WINDRES := @WINDRES@
52 OBJCOPY := @OBJCOPY@
53
54 include $(srcdir)/../Makefile.common
55
56 MINGW_INCLUDES := -I. -I$(srcdir) -I$(mingw_source)/include $(w32api_include) -I$(updir)/bz2lib
57
58 MINGW_CXXFLAGS := -MMD $(CXXFLAGS) -mno-cygwin $(MINGW_INCLUDES) -mwindows
59 MINGW_CFLAGS := -MMD $(CFLAGS) -mno-cygwin $(MINGW_INCLUDES) -mwindows
60 # to avoid false errors that assembly generates
61 WARNONLY_CFLAGS := -MMD @CFLAGS@ -Winline -Wall -Wpointer-arith -Wcast-align \
62 -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \
63 -Wmissing-declarations -Wcomments \
64 -mno-cygwin $(MINGW_INCLUDES) -mwindows
65
66 ZLIB := zlib/libzcygw.a
67 BZ2LIB := $(bupdir)/bz2lib/libbz2.a
68 libmingw32.a := $(mingw_build)/libmingw32.a
69 libuser32 := $(w32api_lib)/libuser32.a
70 libkernel32 := $(w32api_lib)/libkernel32.a
71 libcomctl32 := $(w32api_lib)/libcomctl32.a
72
73 ALL_DEP_LDLIBS := $(ZLIB) $(BZ2LIB) $(w32api_lib)/libole32.a $(w32api_lib)/libwsock32.a \
74 $(w32api_lib)/libnetapi32.a $(w32api_lib)/libadvapi32.a \
75 $(w32api_lib)/libuuid.a $(libkernel32) $(libuser32) \
76 $(libcomctl32) $(libmingw32)
77
78 ALL_LDLIBS := ${patsubst $(mingw_build)/lib%.a,-l%,\
79 ${patsubst $(w32api_lib)/lib%.a,-l%,\
80 ${filter-out $(libmingw32),\
81 ${filter-out $(libuser32),\
82 ${filter-out $(libkernel32), $(ALL_DEP_LDLIBS)}}}}}
83
84 ALL_LDFLAGS := ${filter-out -I%, \
85 ${filter-out -W%, \
86 -B$(w32api_lib)/ -B${mingw_build}/ $(MINGW_CFLAGS) $(LDFLAGS)}}
87
88 PROGS := setup$(EXEEXT)
89
90 OBJS = \
91 archive.o \
92 archive_tar.o \
93 archive_tar_file.o \
94 autoload.o \
95 category.o \
96 choose.o \
97 cistring.o \
98 compress.o \
99 compress_bz.o \
100 compress_gz.o \
101 concat.o \
102 cygpackage.o \
103 desktop.o \
104 dialog.o \
105 diskfull.o \
106 download.o \
107 find.o \
108 filemanip.o \
109 fromcwd.o \
110 GetOption.o \
111 geturl.o \
112 hash.o \
113 ini.o \
114 inilex.o \
115 iniparse.o \
116 install.o \
117 io_stream.o \
118 io_stream_cygfile.o \
119 io_stream_file.o \
120 io_stream_memory.o \
121 localdir.o \
122 log.o \
123 main.o \
124 mingw_getopt.o \
125 mkdir.o \
126 mklink2.o \
127 mount.o \
128 msg.o \
129 net.o \
130 netio.o \
131 nio-ie5.o \
132 nio-file.o \
133 nio-ftp.o \
134 nio-http.o \
135 Option.o \
136 package_db.o \
137 package_meta.o \
138 package_source.o \
139 package_version.o \
140 PickCategoryLine.o \
141 PickLine.o \
142 PickPackageLine.o \
143 PickView.o \
144 postinstall.o \
145 proppage.o \
146 propsheet.o \
147 res.o \
148 rfc1738.o \
149 root.o \
150 script.o \
151 setup_version.o \
152 simpsock.o \
153 site.o \
154 source.o \
155 splash.o \
156 state.o \
157 String++.o \
158 threebar.o \
159 version.o \
160 win32.o \
161 window.o \
162 $(MC_OBJS) \
163 $E
164
165 .SUFFIXES:
166 .NOEXPORT:
167
168 .PHONY: all install clean realclean
169
170 all: Makefile $(PROGS)
171
172 setup$(EXEEXT): $(OBJS) $(ALL_DEP_LDLIBS)
173 ifdef VERBOSE
174 $(CXX) $(MINGW_CXXFLAGS) -o $@ ${filter-out $(ALL_DEP_LIBS),$^}
175 else
176 @echo $(CXX) ... -o $@ $(OBJS)
177 @$(CXX) $(MINGW_CXXFLAGS) -o $@ ${filter-out $(ALL_DEP_LIBS),$^} $(ALL_LDFLAGS) $(ALL_LDLIBS)
178 endif
179 @chmod a-x $@
180
181 mingw_getopt.o: $(cygwin_source)/lib/getopt.c
182 ifdef VERBOSE
183 ${filter-out -I$(newlib_source)/%,$(COMPILE_CC)} $c -o $(@D)/$(basename $@)$o $(MINGW_CFLAGS) $<
184 else
185 @echo $(CC) $c -o $(@D)/$(basename $@)$o $(MINGW_CFLAGS) ... $^;\
186 ${filter-out -I$(newlib_source)/%,$(COMPILE_CC)} $c -o $(@D)/$(basename $@)$o $(MINGW_CFLAGS) $<
187 endif
188
189 clean:
190 rm -f *.o $(PROGS) iniparse.c* iniparse.h* inilex.c* *.d
191 $(MAKE) -C zlib clean
192
193 realclean: clean
194 rm -f Makefile
195 rm -f config.cache config.log config.status
196
197 install: all
198 $(SHELL) $(updir1)/mkinstalldirs $(bindir) $(etcdir)
199 for i in $(PROGS) ; do \
200 n=`echo $$i | sed '$(program_transform_name)'`; \
201 $(INSTALL_PROGRAM) $$i $(bindir)/$$n; \
202 done
203
204 $(libmingw32): $(mingw_build)/Makefile
205 @$(MAKE) -C $(@D) $(@F)
206
207 $(ZLIB): zlib/Makefile
208 $(MAKE) -C $(@D) $(@F) CC="$(CC)" CFLAGS='$(MINGW_CFLAGS)'
209
210 $(BZ2LIB): $(bupdir)/bz2lib/Makefile
211 $(MAKE) -C $(@D) $(@F) CC="$(CC)" CFLAGS='$(MINGW_CFLAGS)'
212
213 setup_version.c : $(srcdir)/ChangeLog Makefile
214 V=`grep '^\$$Revision.*' $(srcdir)/ChangeLog \
215 | sed -e 's/\$$Revision:* *//' \
216 -e 's/ *$$.*//'` ;\
217 (echo '#define VERSION_PREFIX "%%% setup-version"';\
218 echo 'static const char version_store[] = VERSION_PREFIX " '$$V'";';\
219 echo 'const char *version = version_store + sizeof (VERSION_PREFIX);') > version.tmp;\
220 mv version.tmp setup_version.c
221
222 %.o: %.rc
223 ifdef VERBOSE
224 $(WINDRES) --include-dir $(srcdir) --include-dir $(w32api_source)/include -o $@ $<
225 else
226 @echo $(WINDRES) -o $@ $(<F)
227 @$(WINDRES) --include-dir $(srcdir) --include-dir $(w32api_source)/include -o $@ $<
228 endif
229
230 %.o: %.c
231 ifdef VERBOSE
232 $(CC) $(MINGW_CFLAGS) -c -o $@ $<
233 else
234 @echo $(CC) -c $(CFLAGS) ... $(<F)
235 @$(CC) $(MINGW_CFLAGS) -c -o $@ $<
236 endif
237
238 %.o: %.cc
239 ifdef VERBOSE
240 $(CXX) $(MINGW_CXXFLAGS) -c -o $@ $<
241 else
242 @echo $(CXX) -c $(CXXFLAGS) ... $(<F)
243 @$(CXX) $(MINGW_CXXFLAGS) -c -o $@ $<
244 endif
245
246 autoload.o: autoload.c
247 ifdef VERBOSE
248 $(CC) $(WARNONLY_CFLAGS) -c -o $@ $< -fno-inline-functions
249 else
250 @echo $(CC) -c $(WARNONLY_CFLAGS) ... $(<F) -fno-inline-functions
251 @$(CC) $(WARNONLY_CFLAGS) -c -o $@ $< -fno-inline-functions
252 endif
253
254 inilex.o: inilex.cc
255 ifdef VERBOSE
256 $(CXX) @CXXFLAGS@ $(WARNONLY_CFLAGS) -fno-rtti -c -o $@ $<
257 else
258 @echo $(CXX) -c @CXXFLAGS@ $(WARNONLY_CFLAGS) ... $(<F) -fno-rtti
259 @$(CXX) @CXXFLAGS@ $(WARNONLY_CFLAGS) -c -o $@ $< -fno-rtti
260 endif
261
262 iniparse.cc iniparse.h : iniparse.y
263 bison -d -o iniparse.cc $(srcdir)/iniparse.y
264 @mv iniparse.cc.h iniparse.h 2>/dev/null || mv iniparse.hh iniparse.h
265
266 inilex.cc : inilex.l iniparse.h
267 flex -8 $(srcdir)/inilex.l
268 mv lex.yy.c inilex.cc
269
270 D:=$(wildcard *.d)
271 ifneq ($D,)
272 include $D
273 endif
This page took 0.042207 seconds and 5 git commands to generate.