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