OSDN Git Service

Work around an autoconf bug.
[mingw/mingw-get.git] / Makefile.in
1 # @configure_input@
2 #
3 # $Id$
4
5 PACKAGE_TARNAME = @PACKAGE_TARNAME@
6 PACKAGE_VERSION = @PACKAGE_VERSION@
7
8 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9 # Copyright (C) 2009, 2010, MinGW Project
10 #
11 #
12 # Makefile template for mingw-get
13 #
14 #
15 # This is free software.  Permission is granted to copy, modify and
16 # redistribute this software, under the provisions of the GNU General
17 # Public License, Version 3, (or, at your option, any later version),
18 # as published by the Free Software Foundation; see the file COPYING
19 # for licensing details.
20 #
21 # Note, in particular, that this software is provided "as is", in the
22 # hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23 # even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24 # PARTICULAR PURPOSE.  Under no circumstances will the author, or the
25 # MinGW Project, accept liability for any damages, however caused,
26 # arising from the use of this software.
27 #
28 PACKAGE_SUBSYSTEM = @host_os@
29
30 srcdir = @srcdir@
31 abs_top_srcdir = @abs_top_srcdir@
32
33 DEBUGLEVEL = 0
34
35 VPATH = @top_srcdir@/src:@top_srcdir@/src/pkginfo:@top_srcdir@/tinyxml
36
37 CC = @CC@
38 CFLAGS = @CFLAGS@
39 CPPFLAGS = @CPPFLAGS@ -D DEBUGLEVEL=$(DEBUGLEVEL) $(INCLUDES)
40
41 CXX = @CXX@
42 CXXFLAGS = $(CFLAGS)
43
44 INCLUDES = -I ${srcdir}/src -I ${srcdir}/src/pkginfo -I ${srcdir}/tinyxml
45
46 LEX = @LEX@
47
48 AR = @AR@
49 ARFLAGS = @ARFLAGS@
50
51 OBJEXT = @OBJEXT@
52 EXEEXT = @EXEEXT@
53
54 LDFLAGS = @LDFLAGS@
55 LIBS = -Wl,-Bstatic -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
56
57 CORE_DLL_OBJECTS = climain.$(OBJEXT) \
58    pkgbind.$(OBJEXT) pkginet.$(OBJEXT) pkgstrm.$(OBJEXT) pkgname.$(OBJEXT) \
59    pkgexec.$(OBJEXT) pkgfind.$(OBJEXT) pkginfo.$(OBJEXT) pkgspec.$(OBJEXT) \
60    sysroot.$(OBJEXT) pkghash.$(OBJEXT) pkgkeys.$(OBJEXT) pkgdeps.$(OBJEXT) \
61    mkpath.$(OBJEXT)  pkgreqs.$(OBJEXT) pkginst.$(OBJEXT) tarproc.$(OBJEXT) \
62    xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT)  dmh.$(OBJEXT) \
63    tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
64    tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT)
65
66 all: pkginfo$(EXEEXT) mingw-get$(EXEEXT) mingw-get-0.dll
67
68 pkginfo$(EXEEXT):  driver.$(OBJEXT) pkginfo.$(OBJEXT)
69         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
70
71 mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT)
72         $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
73
74 mingw-get-0.dll: $(CORE_DLL_OBJECTS)
75         $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
76
77 # Compilation and dependency tracking...
78 #
79 DEPFLAGS = -MM -MP -MD
80 sinclude *.d
81
82 %.$(OBJEXT): %.c
83         $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
84         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
85
86 %.$(OBJEXT): %.cpp
87         $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
88         $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
89
90 # Installation tools and directory paths...
91 #
92 mkinstalldirs = @MKDIR_P@
93
94 prefix = @prefix@
95 exec_prefix = @exec_prefix@
96 localstatedir = @localstatedir@
97 libexecdir = @libexecdir@
98 bindir = @bindir@
99
100 PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
101
102 INSTALL = @INSTALL@
103 INSTALL_DATA = @INSTALL_DATA@
104 INSTALL_PROGRAM = @INSTALL_PROGRAM@
105 INSTALL_SCRIPT = @INSTALL_SCRIPT@
106
107 STRIP = @STRIP@
108 LN_S = @LN_S@
109
110 # Installation rules...
111 #
112 installdirs:
113         $(mkinstalldirs) ${bindir}
114         $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
115         $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
116
117 install: installdirs install-profile
118         $(INSTALL_PROGRAM) pkginfo$(EXEEXT) ${bindir}
119         $(INSTALL_PROGRAM) mingw-get$(EXEEXT) ${bindir}
120         $(INSTALL_DATA) mingw-get-0.dll ${libexecdir}/${PACKAGE_TARNAME}
121
122 install-profile:
123         $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
124           ${PACKAGE_CONFIG_DIR}/defaults.xml
125
126 install-strip: install
127         $(STRIP) ${bindir}/pkginfo$(EXEEXT)
128         $(STRIP) ${bindir}/mingw-get$(EXEEXT)
129         $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/mingw-get-0.dll
130
131 # Packaging and distribution...
132 #
133 LICENCE_FILES = README COPYING
134 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog version.c.in \
135   configure.ac configure Makefile.in install-sh
136
137 SRCDIST_SUBDIRS = src src/pkginfo tinyxml xml
138
139 # The names of distributed pacakge archive files incorporate version
140 # information, derived from PACKAGE_VERSION; this is decomposed, so that
141 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
142 # number and any qualifying suffix, which specifies development status.
143 # Additionally, the package maintainer may specify, (at `make dist' time),
144 # a SNAPSHOT qualifier; if specified, this will be appended, (literally),
145 # to the principal version number component of the package version number,
146 # as it appears in the distributed archive file names.
147 #
148 PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
149 PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
150 PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
151   -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
152   -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
153   -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
154 PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
155
156 dist: srcdist bindist
157
158 bindist: all licdist
159         rm -rf staged
160         $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
161         cd staged; tar chf - bin/pkginfo$(EXEEXT) | gzip -c > \
162           ../pkginfo-$(PACKAGE_DISTVERSION)-bin.tar.gz
163         rm staged/bin/pkginfo$(EXEEXT)
164         cd staged; tar chf - * | gzip -c > ../$(PACKAGE_DISTNAME)-bin.tar.gz
165         cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
166         rm -rf staged
167
168 licdist:
169         rm -rf shared
170         $(mkinstalldirs) ./shared/doc/${PACKAGE_TARNAME}
171         cd ./shared/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
172           do $(LN_S) ${abs_top_srcdir}/$$file .; done
173         tar chf - shared | gzip -c > $(PACKAGE_DISTNAME)-lic.tar.gz
174         rm -rf shared
175
176 srcdist: pkginfo.c
177         rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT}
178         cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
179           $(LN_S) ${abs_top_srcdir}/$$file .; done
180         for dir in $(SRCDIST_SUBDIRS); do \
181           mkdir ${PACKAGE_DISTROOT}/$$dir && cd ${PACKAGE_DISTROOT}/$$dir; \
182           for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
183             if test -f ${abs_top_srcdir}/$$dir/$$file; then \
184               $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
185             fi; \
186           done; \
187         cd ${CURDIR}; done
188         cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/$^ .
189         tar chf - ${PACKAGE_DISTROOT} | gzip -c > ${PACKAGE_DISTNAME}-src.tar.gz
190         rm -rf ${PACKAGE_DISTROOT}
191
192 # Workspace clean-up...
193 #
194 clean:
195         rm -f *.$(OBJEXT) *.d *.dll pkginfo$(EXEEXT) mingw-get$(EXEEXT)
196
197 distclean: clean
198         rm -f config.* version.c Makefile
199
200 maintainer-clean: distclean
201         rm -f pkginfo.c *-$(PACKAGE_DISTVERSION)-*.tar.gz
202         rm -rf ${PACKAGE_DISTROOT} staged
203
204 # $RCSfile$: end of file