Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / Makefile.in
1 #
2 # uCsim Makefile
3 #
4 # (c) Drotos Daniel, Talker Bt. 1997,99
5 #
6
7 STARTYEAR       = 1997
8
9 SHELL           = /bin/sh
10
11 include packages.mk
12 #PKGS           = cmd.src sim.src gui.src s51.src avr.src z80.src doc
13
14 VPATH           = @srcdir@
15 srcdir          = @srcdir@
16
17 top_builddir    = @top_builddir@
18 top_srcdir      = @top_srcdir@
19
20 # Compiling entire program or any subproject
21 # ------------------------------------------
22 all: checkconf
23         $(MAKE) -f main.mk all
24         @for pkg in $(PKGS); do\
25           $(MAKE) -C $$pkg $$pkg ;\
26         done
27         $(MAKE) -f main.mk main_app
28
29 libs: main.mk
30         $(MAKE) -f main.mk libs
31
32
33 # Compiling and installing everything and runing test
34 # ---------------------------------------------------
35 .PHONY: install INSTALL Install
36 install:
37         $(MAKE) -f main.mk install
38         @for pkg in $(PKGS); do\
39           $(MAKE) -C $$pkg install ;\
40         done
41
42
43 # Deleting all the installed files
44 # --------------------------------
45 uninstall:
46         $(MAKE) -f main.mk uninstall
47         @for pkg in $(PKGS); do\
48           $(MAKE) -C $$pkg uninstall ;\
49         done
50
51
52 # Deleting all files created by building the program
53 # --------------------------------------------------
54 clean:
55         $(MAKE) -f $(srcdir)/clean.mk clean EXEEXT=$(EXEEXT)
56         @for pkg in $(PKGS_ALL); do\
57           $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk clean EXEEXT=$(EXEEXT) ;\
58         done
59
60
61 # Deleting all files created by configuring or building the program
62 # -----------------------------------------------------------------
63 distclean: clean
64         $(MAKE) -f $(srcdir)/clean.mk distclean
65         @for pkg in $(PKGS_ALL); do\
66           $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk distclean ;\
67         done
68         rm -rf doc/*~ doc/*.bak Makefile packages.mk libtool
69
70
71 # Like clean but some files may still exist
72 # -----------------------------------------
73 mostlyclean: clean
74         $(MAKE) -f clean.mk mostlyclean
75         @for pkg in $(PKGS_ALL); do\
76           $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk mostlyclean ;\
77         done
78
79
80 # Deleting everything that can reconstructed by this Makefile. It deletes
81 # everything deleted by distclean plus files created by bison, stc.
82 # -----------------------------------------------------------------------
83 realclean: distclean
84         $(MAKE) -f clean.mk realclean
85         @for pkg in $(PKGS_ALL); do\
86           $(MAKE) -C $$pkg -f ../$(srcdir)/$$pkg/clean.mk realclean ;\
87         done
88
89
90 # Creating distribution
91 # ---------------------
92 dist: distclean
93         @if [ -f devel ]; then\
94           rm -f devel; mkdist; touch devel;\
95         else\
96           mkdist;\
97         fi
98
99
100 # Performing self-test
101 # --------------------
102 check:
103         $(MAKE) -f main.mk check
104         @for pkg in $(PKGS); do\
105           $(MAKE) -C $$pkg check ;\
106         done
107
108 test:
109         $(MAKE) -f main.mk test
110         @for pkg in $(PKGS); do\
111           $(MAKE) -C $$pkg test ;\
112         done
113
114
115 # Performing installation test
116 # ----------------------------
117 installcheck:
118
119
120 # Creating dependencies
121 # ---------------------
122 dep:
123         $(MAKE) -f main.mk dep
124         @for pkg in $(PKGS); do\
125           $(MAKE) -C $$pkg dep ;\
126         done
127
128
129 # My rules
130 # --------
131 putcopyright:
132         'put(c)' -s $(STARTYEAR) *.cc *.h *.y *.l
133
134 start:
135         date '+%Y.%m.%d-%H:%M' >.start
136
137 newer: distclean
138         @if [ -f .start ]; then \
139           tar cvf - \
140             `find . -newer .start -type f -print` |\
141           gzip -9c >ucsim-newer-`cat .start`_`date '+%Y.%m.%d-%H:%M'`_`hostname`.tgz; \
142         else \
143           echo ".start file not found.\n"; \
144           exit 1; \
145         fi
146
147 print-newer:
148         @if [ -f .start ]; then \
149           find . -newer .start -type f -print ;\
150         else \
151           echo ".start file not found.\n" ;\
152           exit 1 ;\
153         fi
154
155 new_files:
156         diff -rNu $$HOME/clean-source/sdcc/sim/ucsim .|\
157         grep '^diff' | grep -v .svn | awk '{print $$4}'
158
159 lines:
160         @find . \( -name '*.[ch]' -o -name '*.cc' -o -name '*.hh' \) \
161         -exec cat {} \; | clines
162
163
164 # Remaking configuration
165 # ----------------------
166 configure: configure.in
167         @$(top_srcdir)/mkecho $(top_builddir) "RE-CREATING CONFIGURE"
168         autoconf configure.in >configure
169         chmod 755 configure
170
171 config.status: configure
172         @$(top_srcdir)/mkecho $(top_builddir) "RE-CHECKING CONFIGURATION (re-creating config.status from configure)"
173         @if [ -x ./config.status ]; then \
174           ./config.status -recheck;\
175         else\
176           if [ -x ./conf ]; then\
177             ./conf;\
178           else\
179             ./configure;\
180           fi\
181         fi
182
183 makefiles: config.status
184         @$(top_srcdir)/mkecho $(top_builddir) "RE-MAKING MAKEFILES"
185         $(SHELL) ./config.status
186
187 main.mk: $(srcdir)/main_in.mk config.status
188         @$(top_srcdir)/mkecho $(top_builddir) "RE-MAKING MAIN.MK"
189         $(SHELL) ./config.status
190
191 freshconf: echo_freshconf configure main.mk ddconfig.h
192
193 ddconfig.h: ddconfig_in.h config.status
194         $(SHELL) ./config.status
195
196 echo_freshconf:
197         @$(top_srcdir)/mkecho $(top_builddir) "FRESHCONF"
198
199 checkconf:
200         @$(top_srcdir)/mkecho $(top_builddir) "CHECKCONF"
201         @if [ -f devel ]; then $(MAKE) freshconf; fi
202
203 # End of Makefile