]> cygwin.com Git - cygwin-apps/setup.git/blob - Makefile.in
* cygcalls.c: new, call cygwin1.dll functions directly
[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 SHELL:=@SHELL@
16
17 srcdir:=@srcdir@
18 VPATH:=@srcdir@
19 prefix:=@prefix@
20 exec_prefix:=@exec_prefix@
21
22 bindir:=@bindir@
23 etcdir:=$(exec_prefix)/etc
24 program_transform_name:=@program_transform_name@
25
26 INSTALL:=@INSTALL@
27 INSTALL_PROGRAM:=@INSTALL_PROGRAM@
28 INSTALL_DATA:=@INSTALL_DATA@
29
30 EXEEXT:=@EXEEXT@
31 EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@
32
33 CC:=@CC@
34 CC_FOR_TARGET:=$(CC)
35
36 CFLAGS:=@CFLAGS@ -nostdinc
37 CXXFLAGS:=@CXXFLAGS@ -fno-exceptions -nostdinc++ -fno-rtti
38
39 WINDRES:=@WINDRES@
40 OBJCOPY:=@OBJCOPY@
41
42 include $(srcdir)/../Makefile.common
43
44 MINGW_INCLUDES:=-I$(mingw_source)/include -I$(w32api_include)
45
46 MINGW_CXXFLAGS:=$(CXXFLAGS) -mno-cygwin $(MINGW_INCLUDES)
47 MINGW_CFLAGS:=$(CFLAGS) -mno-cygwin $(MINGW_INCLUDES)
48
49 ZLIB=zlib/libzcygw.a
50 libmingw32.a:=$(mingw_build)/libmingw32.a
51 libuser32:=$(w32api_lib)/libuser32.a
52 libkernel32:=$(w32api_lib)/libkernel32.a
53 ALL_DEP_LDLIBS:=$(ZLIB) $(w32api_lib)/libole32.a $(w32api_lib)/libwininet.a \
54 $(w32api_lib)/libnetapi32.a $(w32api_lib)/libadvapi32.a \
55 $(w32api_lib)/libuuid.a $(libkernel32) $(w32api_lib)/libuser32.a \
56 $(libmingw32)
57
58 ALL_LDLIBS:=${patsubst $(mingw_build)/lib%.a,-l%,\
59 ${patsubst $(w32api_lib)/lib%.a,-l%,\
60 ${filter-out $(libmingw32),\
61 ${filter-out $(libuser32),\
62 ${filter-out $(libkernel32), $(ALL_DEP_LDLIBS)}}}}}
63
64 ALL_LDFLAGS:=${filter-out -I%, \
65 ${filter-out -W%, \
66 -B$(w32api_lib)/ -B${mingw_build}/ $(MINGW_CFLAGS) $(LDFLAGS)}}
67
68 PROGS:=setup$(EXEEXT)
69
70 OBJS:=cygcalls.o error.o memory.o setup.o strarry.o cinstall.o path.o pkg.o tar.o xsystem.o
71
72 BUNDLED_FILES:=cygwin1.dll.gz
73 # mount.exe.gz cygpath.exe.gz umount.exe.gz
74 .SUFFIXES:
75 .NOEXPORT:
76
77 .PHONY: all install clean realclean
78 .PRECIOUS: $(utils_build)/cygpath.exe $(utils_build)/mount.exe $(utils_build)/umount.exe $(cygwin_build)/new-cygwin1.dll
79
80 all: Makefile $(PROGS)
81
82 setup$(EXEEXT): $(OBJS) $(ALL_DEP_LDLIBS)
83 ifdef VERBOSE
84 $(CC) -o $@ ${filter-out $(ALL_DEP_LIBS),$^}
85 else
86 @echo $(CC) ... -o $@ $(OBJS)
87 @$(CC) -o $@ ${filter-out $(ALL_DEP_LIBS),$^} $(ALL_LDFLAGS) $(ALL_LDLIBS)
88 endif
89 @chmod a-x $@
90
91 ctar.exe : ctar.o tar.o $(ALL_DEP_LDLIBS)
92 $(CC) -o $@ ctar.o tar.o $(ALL_LDFLAGS) $(ALL_LDLIBS)
93
94 mingw_getopt.o: $(cygwin_source)/getopt.c
95 $(CC) -c -o $@ $(MINGW_CFLAGS) $^
96
97 clean:
98 rm -f *.o *.rc $(PROGS) zlib/*.o zlib/*.a *.exe *.gz
99
100 realclean: clean
101 rm -f Makefile config.cache
102
103 install: all
104 $(SHELL) $(updir1)/mkinstalldirs $(bindir) $(etcdir)
105 for i in $(PROGS) ; do \
106 n=`echo $$i | sed '$(program_transform_name)'`; \
107 $(INSTALL_PROGRAM) $$i $(bindir)/$$n; \
108 done
109
110 $(libmingw32): $(mingw_build)/Makefile
111 @$(MAKE) -C $(@D) $(@F)
112
113 $(ZLIB): zlib/Makefile
114 $(MAKE) -C $(@D) $(@F) CFLAGS='$(MINGW_CFLAGS)'
115
116 %.exe.gz: %.exe
117 gzip -9nf $?
118
119 %.exe: $(utils_build)/%.exe
120 $(OBJCOPY) --strip-unneeded $? $@
121
122 $(utils_build)/%.exe: $(utils_build)/Makefile
123 @$(MAKE) -C $(utils_build) $(@F)
124
125 %.dll.gz: new-%.dll
126 gzip -9nfc $? > $@
127
128 %.dll: $(cygwin_build)/%.dll
129 $(OBJCOPY) --strip-unneeded $? $@
130
131 $(cygwin_build)/%.dll: $(cygwin_build)/Makefile
132 @$(MAKE) -C $(@D) $(@F)
133
134 cinstall.rc: $(BUNDLED_FILES) $(srcdir)/Makefile.in
135 for f in $(BUNDLED_FILES); do \
136 echo `basename $$f .gz` FILE DISCARDABLE '"'$$f'"'; \
137 done > $@
138
139 %.o: %.rc
140 $(WINDRES) -o $@ $?
141
142 %.o: %.c
143 ifdef VERBOSE
144 $(CC) $(MINGW_CFLAGS) -c -o $@ $?
145 else
146 @echo $(CC) -c $(CFLAGS) ... $(?F)
147 @$(CC) $(MINGW_CFLAGS) -c -o $@ $?
148 endif
This page took 0.043417 seconds and 6 git commands to generate.