]> git.zerfleddert.de Git - micropolis/blame - Makefile
add "install" target to Makefile
[micropolis] / Makefile
CommitLineData
7709f34c
MG
1PREFIX=/usr/local
2DATADIR=$(PREFIX)/share/micropolis
3LIBEXECDIR=$(PREFIX)/libexec
4BINDIR=$(PREFIX)/bin
5DOCDIR=$(PREFIX)/share/doc/micropolis
6
7INSTALL=install
8
9DIRS= $(DATADIR)/res/sounds $(DATADIR)/res/dejavu-lgc $(DATADIR)/images \
10 $(DATADIR)/cities $(LIBEXECDIR) $(BINDIR) $(DOCDIR)
11
12RES= res/buildidx.tcl res/button.tcl res/entry.tcl res/help.tcl res/hexa.112 \
13 res/hexa.232 res/hexa.384 res/hexa.385 res/hexa.386 res/hexa.387 \
14 res/hexa.388 res/hexa.456 res/hexa.544 res/hexa.563 res/hexa.999 \
15 res/init.tcl res/listbox.tcl res/menu.tcl res/micropolis.tcl \
16 res/mkindex.tcl res/parray.tcl res/snro.111 res/snro.222 res/snro.333 \
17 res/snro.444 res/snro.555 res/snro.666 res/snro.777 res/snro.888 \
18 res/sound.tcl res/stri.202 res/stri.219 res/stri.301 res/stri.356 \
19 res/tcl.tdx res/tcl.tlb res/tclindex res/tclinit.tcl res/text.tcl \
20 res/tk.tcl res/tk.tdx res/tk.tlb res/tkerror.tcl res/wask.tcl \
21 res/wbudget.tcl res/weditor.tcl res/weval.tcl res/wfile.tcl \
22 res/wfrob.tcl res/wgraph.tcl res/whead.tcl res/whelp.tcl res/wish.tcl \
23 res/wishx.tcl res/wmap.tcl res/wnotice.tcl res/wplayer.tcl \
24 res/wscen.tcl res/wsplash.tcl
25
eb667c9f
MG
26all: res/sim
27
28res/sim: src/sim/sim
7709f34c 29 cp src/sim/sim $@
eb667c9f
MG
30 strip $@
31
7709f34c
MG
32src/sim/sim: tcl tk tclx sim
33 @#
eb667c9f
MG
34
35tcl:
7709f34c 36 cd src/tcl && $(MAKE) MAKEFLAGS=
eb667c9f
MG
37
38tk:
7709f34c 39 cd src/tk && $(MAKE) MAKEFLAGS=
eb667c9f
MG
40
41tclx:
7709f34c 42 cd src/tclx && $(MAKE) MAKEFLAGS=
eb667c9f
MG
43
44sim:
7709f34c 45 cd src/sim && $(MAKE) MAKEFLAGS=
eb667c9f
MG
46
47clean:
7709f34c
MG
48 cd src/sim && $(MAKE) MAKEFLAGS= $@
49 cd src/tcl && $(MAKE) MAKEFLAGS= $@
50 cd src/tk && $(MAKE) MAKEFLAGS= $@
51 cd src/tclx && $(MAKE) MAKEFLAGS= $@
eb667c9f
MG
52 rm -f res/sim
53
7709f34c
MG
54install: res/sim install-dirs install-bin install-res install-images install-cities install-doc
55
56install-dirs:
57 $(INSTALL) -d $(DIRS)
58
59install-bin:
60 $(INSTALL) -m 0755 res/sim $(LIBEXECDIR)/sim
61 $(INSTALL) -m 0755 res/sounds/player $(DATADIR)/res/sounds/player
62 echo "SIMHOME=$(DATADIR); export SIMHOME" >$(PREFIX)/bin/Micropolis
63 echo "echo \"Starting Micropolis in \$${SIMHOME} ... \"" >>$(PREFIX)/bin/Micropolis
64 echo "cd $(DATADIR) && $(LIBEXECDIR)/sim \$$*" >>$(PREFIX)/bin/Micropolis
65 chmod 755 $(PREFIX)/bin/Micropolis
66
67install-res: install-res-sounds install-res-dejavu-lgc
68 for file in $(RES); do \
69 install -m 0644 $$file $(DATADIR)/$$file; \
70 done
71
72install-res-sounds:
73 find res/sounds -type f -name \*.wav -exec $(INSTALL) -m 0644 {} $(DATADIR)/res/sounds/ \;
74
75install-res-dejavu-lgc:
76 find res/dejavu-lgc -type f -exec $(INSTALL) -m 0644 {} $(DATADIR)/res/dejavu-lgc/ \;
77
78install-images:
79 find images -type f -exec $(INSTALL) -m 0644 {} $(DATADIR)/images/ \;
80
81install-cities:
82 find cities -type f -exec $(INSTALL) -m 0644 {} $(DATADIR)/cities/ \;
83
84install-doc:
85 find manual -type f -exec $(INSTALL) -m 0644 {} $(DOCDIR)/ \;
86
87.PHONY: all clean install install-dirs install-bin install-res \
88 install-res-sounds install-res-dejavu-lgc install-images \
89 install-cities install-doc tcl tk tclx sim
Impressum, Datenschutz