chiark / gitweb /
Remove CVS cruft.
[quine] / Makefile.am
1 ## Process with `automake' to generate `Makefile.in'
2 ## -*-makefile-*-
3 ##
4 ## $Id$
5 ##
6 ## Makefile for Quine
7 ##
8 ## (c) 1999 Mark Wooding
9 ##
10
11 ##----- Licensing notice ----------------------------------------------------
12 ##
13 ## This file is part of Quine.
14 ##
15 ## Quine is free software; you can redistribute it and/or modify it
16 ## under the terms of the GNU General Public License as published by
17 ## the Free Software Foundation; either version 2 of the License, or
18 ## (at your option) any later version.
19 ##
20 ## Quine is distributed in the hope that it will be useful, but
21 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23 ## GNU General Public License for more details.
24 ##
25 ## You should have received a copy of the GNU General Public License
26 ## along with Quine; if not, write to the Free Software Foundation,
27 ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28
29 AUTOMAKE_OPTIONS = foreign
30
31 ## --- What needs installing ---
32
33 bin_PROGRAMS = quine
34 noinst_PROGRAMS = ansicquine
35 include_HEADERS = quine.h
36
37 ## --- How to build the program ---
38
39 quine_SOURCES = quine.c qqout.c mdwopt.c quine.h mdwopt.h
40 ansicquine_SOURCES = ansicquine.c
41 EXTRA_DIST = \
42         qqlib.c qqout.c qqlout.c rexxquine.exec bournequine \
43         debian/control debian/changelog debian/rules debian/copyright
44 CLEANFILES = xquine yquine
45 MAINTAINERCLEANFILES = qqout.c qqlout.c $(srcdir)/qqout.c $(srcdir)/qqlout.c
46
47 ## --- I need recursive makeness ---
48 ##
49 ## In this way, I can rebuild `xquine' and `yquine' only when they really
50 ## get needed.
51
52 @SET_MAKE@
53
54 ## --- Some hacking for the bootstrapping process ---
55 ##
56 ## The outputtable library gets built from `qqlib.c'.  I therefore have to
57 ## build a `quine' which can do this.  This is `xquine'.  Then, I can
58 ## build a `yquine' which is capable of writing full `qqout.c' files, with
59 ## which I can build the final glorious `quine'.
60
61 xquine: xquine.o qqlib.o mdwopt.o
62         $(LINK) xquine.o qqlib.o mdwopt.o
63 xquine.o: quine.c
64         $(COMPILE) -c -DQQ_XQUINE $(srcdir)/quine.c -o xquine.o
65
66 yquine: yquine.o qqlib.o qqlout.o mdwopt.o
67         $(LINK) yquine.o qqlib.o qqlout.o mdwopt.o
68 yquine.o: quine.c
69         $(COMPILE) -c -DQQ_YQUINE $(srcdir)/quine.c -o yquine.o
70
71 ## --- The `qqlout.c' file ---
72 ##
73 ## The contents of `qqlib.c' are included in every `qqout.c' file we write.
74 ## But I've got to get it from somewhere so that I can write it to the first
75 ## `qqout.c' file.  The solution is, as described above, to use a cut-down
76 ## `quine' program which can just about build `qqlout.c' which contains only
77 ## the library.
78
79 qqlout.c: qqlib.c
80         if [ -z "$(qq_xquine)" ]; then \
81           $(MAKE) qq_xquine=true xquine; \
82         else :; fi
83         ./xquine --qqlib $(srcdir)/qqlib.c -o qqlout.c
84
85 ## --- The `qqout.c' file ---
86 ##
87 ## This contains the complete source code for the program.
88
89 qqout.c: quine.c qqlout.c qqlib.c mdwopt.c quine.h mdwopt.h
90         if [ -z "$(qq_yquine)" ]; then \
91           $(MAKE) qq_yquine=true yquine; \
92         else :; fi
93         touch qqout.c
94         -ln qqout.c qqlout.c $(srcdir)
95         $(MAKE) distdir
96         rm qqout.c
97         find $(distdir) \( -type f -o -type l \) ! -name qqout.c -print | \
98           ./yquine -o $(distdir)/qqout.c
99         ln $(distdir)/qqout.c qqout.c
100         rm -rf $(distdir)
101
102 ##----- That's all, folks ---------------------------------------------------