OSDN Git Service

Implement hooks to support lua scripting interface.
[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, 2011, 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 = @DEBUGLEVEL@
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 -llua -lz -lbz2 -llzma -Wl,-Bdynamic -lwininet
56
57 CORE_DLL_OBJECTS  =  climain.$(OBJEXT) pkgshow.$(OBJEXT) dmh.$(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) pkgunst.$(OBJEXT) \
62    tarproc.$(OBJEXT) xmlfile.$(OBJEXT) keyword.$(OBJEXT) vercmp.$(OBJEXT) \
63    tinyxml.$(OBJEXT) tinyxmlparser.$(OBJEXT) \
64    tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT)
65
66 BIN_PROGRAMS = pkginfo$(EXEEXT) mingw-get$(EXEEXT)
67 LIBEXEC_PROGRAMS = gui$(EXEEXT) lastrites$(EXEEXT)
68 LIBEXEC_DATA = mingw-get-0.dll
69
70 all: $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA)
71
72 pkginfo$(EXEEXT):  driver.$(OBJEXT) pkginfo.$(OBJEXT)
73         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
74
75 mingw-get$(EXEEXT): clistub.$(OBJEXT) version.$(OBJEXT) getopt.$(OBJEXT)
76         $(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $+
77
78 GUI_LDFLAGS = -mwindows $(LDFLAGS)
79
80 gui$(EXEEXT): guimain.$(OBJEXT)
81         $(CXX) -o $@ $(CXXFLAGS) $(GUI_LDFLAGS) $+
82
83 lastrites$(EXEEXT): rites.$(OBJEXT)
84         $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $+
85
86 mingw-get-0.dll: $(CORE_DLL_OBJECTS)
87         $(CXX) -shared -o $@ $(CXXFLAGS) $(LDFLAGS) $+ $(LIBS)
88
89 # Compilation and dependency tracking...
90 #
91 DEPFLAGS = -MM -MP -MD
92 sinclude *.d
93
94 %.$(OBJEXT): %.c
95         $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $<
96         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
97
98 %.$(OBJEXT): %.cpp
99         $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $<
100         $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
101
102 # Installation tools and directory paths...
103 #
104 mkinstalldirs = @MKDIR_P@
105
106 prefix = @prefix@
107 exec_prefix = @exec_prefix@
108 localstatedir = @localstatedir@
109 libexecdir = @libexecdir@
110 bindir = @bindir@
111
112 PACKAGE_CONFIG_DIR = ${localstatedir}/lib/${PACKAGE_TARNAME}/data
113
114 INSTALL = @INSTALL@
115 INSTALL_DATA = @INSTALL_DATA@
116 INSTALL_PROGRAM = @INSTALL_PROGRAM@
117 INSTALL_SCRIPT = @INSTALL_SCRIPT@
118
119 STRIP = @STRIP@
120 LN_S = @LN_S@
121
122 # Installation rules...
123 #
124 installdirs:
125         $(mkinstalldirs) ${bindir}
126         $(mkinstalldirs) ${libexecdir}/${PACKAGE_TARNAME}
127         $(mkinstalldirs) ${PACKAGE_CONFIG_DIR}
128
129 install: installdirs install-profile
130         for image in $(BIN_PROGRAMS); do \
131           $(INSTALL_PROGRAM) $$image ${bindir}; \
132           done
133         for image in $(LIBEXEC_PROGRAMS); do \
134           $(INSTALL_PROGRAM) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
135           done
136         for image in $(LIBEXEC_DATA); do \
137           $(INSTALL_DATA) $$image ${libexecdir}/${PACKAGE_TARNAME}; \
138           done
139
140 install-profile:
141         $(INSTALL_DATA) ${srcdir}/xml/profile.xml \
142           ${PACKAGE_CONFIG_DIR}/defaults.xml
143
144 install-strip: install
145         for image in $(BIN_PROGRAMS); do \
146           $(STRIP) ${bindir}/$$image; \
147           done
148         for image in $(LIBEXEC_PROGRAMS) $(LIBEXEC_DATA); do \
149           $(STRIP) ${libexecdir}/${PACKAGE_TARNAME}/$$image; \
150           done
151
152 # Packaging and distribution...
153 #
154 LICENCE_FILES = README COPYING
155 SRCDIST_FILES = $(LICENCE_FILES) ChangeLog NEWS INSTALL \
156   aclocal.m4 configure.ac configure Makefile.in version.c.in
157
158 SRCDIST_SUBDIRS = build-aux m4 src src/pkginfo srcdist-doc tinyxml xml
159
160 # The names of distributed pacakge archive files incorporate version
161 # information, derived from PACKAGE_VERSION; this is decomposed, so that
162 # the PACKAGE_SUBSYSTEM may be interposed between the principal version
163 # number and any qualifying suffix, which specifies development status.
164 # Additionally, the package maintainer may specify, (at `make dist' time),
165 # a SNAPSHOT qualifier; if specified, this will be appended, (literally),
166 # to the principal version number component of the package version number,
167 # as it appears in the distributed archive file names.
168 #
169 PACKAGE_DISTROOT = $(PACKAGE_TARNAME)-$(PACKAGE_ROOTVERSION)
170 PACKAGE_ROOTVERSION = `echo $(PACKAGE_VERSION) | sed 's,-[^0-9].*,,'`
171 PACKAGE_DISTVERSION = `echo $(PACKAGE_VERSION)-$(PACKAGE_SUBSYSTEM) | sed \
172   -e 's,-[^0-9],-$(PACKAGE_SUBSYSTEM)&,' \
173   -e 's,\(-$(PACKAGE_SUBSYSTEM).*\)-$(PACKAGE_SUBSYSTEM),\1,' \
174   -e 's,-$(PACKAGE_SUBSYSTEM),$(SNAPSHOT)&,'`
175 PACKAGE_DISTNAME = $(PACKAGE_TARNAME)-$(PACKAGE_DISTVERSION)
176
177 dist: srcdist bindist readme.txt
178
179 # Specify default compression command, and associated file name extension,
180 # for creation and identification of packaged tar archives.
181 #
182 TARZIP = xz
183 TAREXT = tar.$(TARZIP)
184
185 bindist: all licdist
186         rm -rf staged
187         $(MAKE) --no-print-directory prefix=`pwd`/staged install-strip
188         cd staged; tar chf - bin/pkginfo$(EXEEXT) | $(TARZIP) -c > \
189           ../pkginfo-$(PACKAGE_DISTVERSION)-bin.$(TAREXT)
190         rm staged/bin/pkginfo$(EXEEXT)
191         cd staged; tar chf - * | $(TARZIP) -c > \
192           ../$(PACKAGE_DISTNAME)-bin.$(TAREXT)
193         cd staged; zip -r ../$(PACKAGE_DISTNAME)-bin.zip *
194         rm -rf staged
195
196 licdist:
197         rm -rf share
198         $(mkinstalldirs) ./share/doc/${PACKAGE_TARNAME}
199         cd ./share/doc/${PACKAGE_TARNAME}; for file in $(LICENCE_FILES); \
200           do test -f ${abs_top_srcdir}/$$file \
201             && $(LN_S) ${abs_top_srcdir}/$$file . \
202             || $(LN_S) ${CURDIR}/$$file .; \
203           done
204         tar chf - share | $(TARZIP) -c > $(PACKAGE_DISTNAME)-lic.$(TAREXT)
205         rm -rf share
206
207 srcdist: srcdist-doc
208         rm -rf ${PACKAGE_DISTROOT} && mkdir ${PACKAGE_DISTROOT}
209         cd ${PACKAGE_DISTROOT}; for file in $(SRCDIST_FILES); do \
210           test -f ${abs_top_srcdir}/$$file \
211             && $(LN_S) ${abs_top_srcdir}/$$file . \
212             || $(LN_S) ../$$file .; \
213           done
214         for dir in $(SRCDIST_SUBDIRS); do \
215           mkdir ${PACKAGE_DISTROOT}/$$dir && cd ${PACKAGE_DISTROOT}/$$dir; \
216           for file in `cd ${abs_top_srcdir}/$$dir && echo *`; do \
217             if test -f ${abs_top_srcdir}/$$dir/$$file; then \
218               $(LN_S) ${abs_top_srcdir}/$$dir/$$file .; \
219             fi; \
220           done; \
221         cd ${CURDIR}; done
222         cd ${PACKAGE_DISTROOT}/src/pkginfo; $(LN_S) ${CURDIR}/pkginfo.c .
223         tar chf - ${PACKAGE_DISTROOT} | $(TARZIP) -c > \
224           ${PACKAGE_DISTNAME}-src.$(TAREXT)
225         rm -rf ${PACKAGE_DISTROOT}
226
227 # README, INSTALL and NEWS files to be included in the source distribution
228 # are generated on demand, as indirect side effects of a set of phoney goals
229 # so that they are always regenerated for each distribution, from templates
230 # in srcdist-doc so that we can make them version specific.
231 #
232 vpath %.in ${srcdir}/srcdist-doc
233 srcdist-doc: README.dist NEWS.dist INSTALL.dist
234
235 # We need to ensure that, when we invoke nroff, the generated output
236 # will be suited to an ASCII class of typesetter; without the -Tascii
237 # option, GNU nroff will substitute Unicode hyphens (u2010) in place
238 # of ASCII hyphens (code 45).
239 #
240 NROFF = nroff -Tascii
241
242 %.dist: %.in gendoc.simple.sed
243         sed -f gendoc.simple.sed $< | $(NROFF) > $*
244
245 %.simple.sed: %.sed.in
246         sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
247             -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", $< > $@
248
249 %.combined.sed: %.sed.in
250         sed -e s,'$${PACKAGE_DIRNAME}',"${PACKAGE_DISTROOT}", \
251             -e s,'$${PACKAGE_DISTNAME}',"${PACKAGE_DISTNAME}", \
252             -e s,'^# *cut:',, $< > $@
253
254 # The following rules use sed and awk to match the RCS Id keyword;
255 # we define and use the following macro, in the form "$(DOLLAR)Id:",
256 # to avoid unwanted substitution on CVS checkout.
257 #
258 DOLLAR = $$
259
260 # The following rule provides a mechanism for generating a composite from
261 # README, INSTALL and NEWS, for use as an on-line package description.
262 #
263 readme.txt: gendoc.combined.sed readme.txt.tag readme.txt.in
264         sed s,'$(DOLLAR)Id:.*',"`cat $@.tag`", $@.in > $@
265         echo '$$Document: $@ $$: end of file' >> $@
266         rm -f gendoc.combined.sed $@.*
267
268 # There should be a new generation of readme.txt for each package release;
269 # since each release should also include an updated NEWS file; we adopt the
270 # ID tag-line from NEWS.in, as most the appropriate template for generation
271 # of a corresponding tag-line for readme.in
272 #
273 readme.txt.tag: NEWS.in
274         awk '/\$(DOLLAR)Id:/{ $$2 = "readme.txt\\,v"; print }' $^ > $@
275
276 # The tag-line generated by the preceding rule may then be substituted, by
277 # the primary readme.txt generation rule above, into the document template
278 # generated by the following rule
279 #
280 readme.txt.in: README.in NEWS.in INSTALL.in
281         rm -f $@
282         for input in $^; do \
283           sed -f gendoc.combined.sed $$input | $(NROFF) >> $@; \
284           done
285
286 # Workspace clean-up...
287 #
288 clean:
289         rm -f *.$(OBJEXT) *.d *.dll $(BIN_PROGRAMS) $(LIBEXEC_PROGRAMS)
290
291 distclean: clean
292         rm -f config.* version.c
293
294 maintainer-clean: distclean
295         rm -f README NEWS INSTALL readme.txt Makefile pkginfo.c
296         rm -f *-$(PACKAGE_DISTVERSION)-*.tar.* *-$(PACKAGE_DISTVERSION)-*.zip
297         rm -rf ${PACKAGE_DISTROOT} staged ${srcdir}/autom4te.cache
298
299 # $RCSfile$: end of file