1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
# Makefile for c-evo-dh
# Set temporary HOME for lazarus primary config directory
HOME=tmphome
B_MODE ?= Release
prefix ?= /usr
# Debian uses libexec & games directories. Arch does not.
BinDir ?= /bin
LibDir ?= /lib
ShareDir ?= /share/c-evo-dh
ExecDir ?= /lib
FPC-VERSION = $(shell fpc -iV)
# Cleaner build log if jobs are spearate
.NOTPARALLEL:
all: stdai c-evo-dh-gtk2
stdai: AI/StdAI/*.*
cp -p Pascal/$(B_MODE).cfg AI/StdAI/fpc.cfg
# Build AI module (Peephole broken in fpc <= 3.2.2)
if [ $(FPC-VERSION) \> 3.2.2 ]; then \
cd AI/StdAI && fpc -d$(B_MODE) -Xc -B -O3 -k-znoexecstack -olibstdai.so StdAI.lpr; \
else \
cd AI/StdAI && fpc -d$(B_MODE) -Xc -B -O3 -OoNOPEEPHOLE -k-znoexecstack -olibstdai.so StdAI.lpr; \
fi
c-evo-dh-gtk2: init-build
lazbuild --bm=$(B_MODE) -B --ws=gtk2 $(LAZDIR) --no-write-project Integrated.lpi
mv c-evo c-evo-dh-gtk2
c-evo-dh-gtk3: init-build
lazbuild --bm=$(B_MODE) -B --ws=gtk3 $(LAZDIR) --no-write-project Integrated.lpi
mv c-evo c-evo-dh-gtk3
c-evo-dh-qt5: init-build
lazbuild --bm=$(B_MODE) -B --ws=qt5 $(LAZDIR) --no-write-project Integrated.lpi
mv c-evo c-evo-dh-qt5
c-evo-dh-qt6: init-build
lazbuild --bm=$(B_MODE) -B --ws=qt6 $(LAZDIR) --no-write-project Integrated.lpi
mv c-evo c-evo-dh-qt6
init-build:
# Show location of gcc support files
grep gcc /etc/fpc.cfg
dirname `gcc -print-libgcc-file-name`
cp -p Pascal/$(B_MODE).cfg fpc.cfg
cp -p Pascal/$(B_MODE).cfg Packages/CevoComponents/fpc.cfg
cp -p Pascal/$(B_MODE).cfg Packages/Common/fpc.cfg
install: install-binary install-data
install-binary:
install -p -Dm 755 c-evo-dh-gtk2 -t "$(DESTDIR)$(prefix)$(ExecDir)/c-evo-dh"
install -p -Dm 755 Linux/c-evo-launch-gtk2 -t "$(DESTDIR)$(prefix)$(BinDir)"
install -p -Dm 644 AI/StdAI/StdAI.ai.txt -t "$(DESTDIR)$(prefix)$(ShareDir)/AI/StdAI"
install -p -Dm 644 AI/StdAI/StdAI.png -t "$(DESTDIR)$(prefix)$(ShareDir)/AI/StdAI"
install -p -Dm 755 AI/StdAI/libstdai.so -t "$(DESTDIR)$(prefix)$(LibDir)/c-evo-dh"
ln -s $(prefix)$(LibDir)/c-evo-dh/libstdai.so "$(DESTDIR)$(prefix)$(ShareDir)/AI/StdAI/libstdai.so"
install -p -Dm 644 Linux/*.metainfo.xml -t "$(DESTDIR)$(prefix)/share/metainfo"
install -p -Dm 644 Desktop/*-gtk2.desktop -t "$(DESTDIR)$(prefix)/share/applications"
install -p -Dm 644 Man/c-evo-launch-gtk2.6 -t "$(DESTDIR)$(prefix)/share/man/man6"
install-data:
install -p -Dm 644 Graphics/*.png -t "$(DESTDIR)$(prefix)$(ShareDir)/Graphics"
install -p -Dm 644 Graphics/*.jpg -t "$(DESTDIR)$(prefix)$(ShareDir)/Graphics"
install -p -Dm 644 Graphics/*.grs -t "$(DESTDIR)$(prefix)$(ShareDir)/Graphics"
install -p -Dm 644 Language.txt -t "$(DESTDIR)$(prefix)$(ShareDir)"
install -p -Dm 644 Language2.txt -t "$(DESTDIR)$(prefix)$(ShareDir)"
install -p -Dm 644 Fonts.txt -t "$(DESTDIR)$(prefix)$(ShareDir)"
install -p -Dm 644 Desktop/c-evo-dh.svg -t "$(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps"
install -p -Dm 644 Help/* -t "$(DESTDIR)$(prefix)$(ShareDir)/Help"
install -p -Dm 644 Maps/* -t "$(DESTDIR)$(prefix)$(ShareDir)/Maps"
install -p -Dm 644 Sounds/* -t "$(DESTDIR)$(prefix)$(ShareDir)/Sounds"
install -p -Dm 644 Tribes/* -t "$(DESTDIR)$(prefix)$(ShareDir)/Tribes"
install -p -Dm 644 Docs/* -t "$(DESTDIR)$(prefix)/share/doc/c-evo-dh-data"
find Localization -type f -exec install -Dm 644 "{}" "$(DESTDIR)$(prefix)$(ShareDir)/{}" \;
clean:
rm -fr lib
rm -fr tmphome
rm -fr Packages/CevoComponents/lib
rm -fr Packages/Common/lib
rm -fr AI/StdAI/lib/
rm -f *.o
rm -f *.ppu
rm -f *.res
rm -f *.trc
rm -f *.cfg
rm -f AI/StdAI/*.so
rm -f AI/StdAI/*.o
rm -f AI/StdAI/*.ppu
rm -f AI/StdAI/*.res
rm -f AI/StdAI/*.s
rm -f AI/StdAI/*.cfg
rm -f Packages/CevoComponents/*.cfg
rm -f Packages/CevoComponents/CevoComponents.pas
rm -f Packages/Common/*.cfg
rm -f c-evo-dh-gtk2
rm -f c-evo-dh-gtk2.dbg
rm -f c-evo-dh-gtk3
rm -f c-evo-dh-gtk3.dbg
rm -f c-evo-dh-qt5
rm -f c-evo-dh-qt5.dbg
rm -f c-evo-dh-fpgui
rm -f c-evo-dh-fpgui.dbg
|