-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
53 lines (41 loc) · 1.45 KB
/
Makefile
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
NIMC=nim
APPNAME=smalltrek
DATE=$(shell date +%Y-%m-%d)
SOURCES = $(shell find src -name '*.nim')
$(APPNAME)-debug: src/*.nim
$(NIMC) c -d:debug -o:$@ src/main.nim
$(APPNAME): src/*.nim
$(NIMC) c -d:release -o:$@ src/main.nim
clean:
rm -vrf src/nimcache $(APPNAME) $(APPNAME)-debug || true
run: $(APPNAME)
./$(APPNAME)
rund: $(APPNAME)-debug
./$(APPNAME)-debug
windows: $(SOURCES)
${NIMC} c -d:release -d:windows --threads:on -o:winversion/${APPNAME}.exe src/main.nim
cp -r assets winversion
cp config.ini winversion
unix2dos winversion/config.ini
find winversion/assets/ -name '*.wav' -delete
rm ${APPNAME}-${DATE}-win32.zip || true
cd winversion; \
zip -r ../${APPNAME}-${DATE}-win32.zip .
linux64: $(SOURCES)
${NIMC} c -d:release --threads:on -o:linux/${APPNAME}.x86_64 src/main.nim
linux32: $(SOURCES)
${NIMC} c -d:release -d:linux32 --threads:on -o:linux/${APPNAME}.x86 src/main.nim
linux: linux32 linux64
cp -r assets linux
cp config.ini linux
find linux/assets/ -name '*.wav' -delete
cd linux; \
tar czf ../${APPNAME}-${DATE}-linux.tar.gz .
osx: $(SOURCES)
${NIMC} c -d:release -d:osx --threads:off -o:${APPNAME}.app/Contents/MacOS/smalltrek src/main.nim
cp -r assets ${APPNAME}.app/Contents/Resources/
cp config.ini ${APPNAME}.app/Contents/Resources/
find ${APPNAME}.app/Contents/Resources/assets/ -name '*.wav' -delete
rm ${APPNAME}-${DATE}-osx.zip || true
zip --symlinks -r ${APPNAME}-${DATE}-osx.zip ${APPNAME}.app
.PHONY: clean run rund