forked from alekmaul/pvsneslib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (71 loc) · 2.57 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# do not forget that to build pvsneslib, you have to install compiler and tools first !
#---------------------------------------------------------------------------------
all:
cd compiler && \
make && \
make install && \
cd ../tools && \
make && \
make install && \
cd ../pvsneslib && \
make && \
cd ../snes-examples && \
make && \
make install && \
echo && \
echo Build finished successfully ! && \
echo
clean:
cd compiler ; \
make clean ; \
cd ../tools ; \
make clean ; \
cd ../pvsneslib ; \
make clean ; \
cd ../devkitsnes/bin ; \
find . -type f -not -name '816-opt.py' -delete ; \
rm -f ../tools/* ; \
cd ../../snes-examples ; \
make clean ; \
rm -rf release
# requirements to launch the "release" rule
doxygenInstalled := $(shell command -v doxygen 2> /dev/null)
operatingSystem=
ifeq ($(OS),Windows_NT)
operatingSystem=windows
else
# only for linux platforms, we use the os-release file
ifneq (,$(wildcard /etc/os-release))
include /etc/os-release
# convert to lower case the result
operatingSystem=linux_$(shell echo $(NAME) | tr A-Z a-z)
else
ifeq ($(shell uname -s),Darwin)
operatingSystem=darwin
else
$(error "Unable to detect your operating system, please update the code in global pvsneslib Makefile to continue")
endif
endif
endif
#---------------------------------------------------------------------------------
# to create the release version for github containing binaries and all snes-examples :
release: all
ifndef doxygenInstalled
$(error "doxygen is not installed but is mandatory to create the release version.")
endif
ifeq ($(operatingSystem),)
$(error "Unable to detect your operating system to create the release version.")
endif
rm -rf release && mkdir -p release/pvsneslib && \
cp -r devkitsnes release/pvsneslib/devkitsnes && \
mkdir release/pvsneslib/pvsneslib && cp -r pvsneslib/include release/pvsneslib/pvsneslib/include && \
cp -r pvsneslib/lib release/pvsneslib/pvsneslib/lib && \
mkdir release/pvsneslib/pvsneslib/docs && cp -r pvsneslib/docs/html release/pvsneslib/pvsneslib/docs/html && \
cp pvsneslib/PVSnesLib_Logo.png release/pvsneslib/pvsneslib/PVSnesLib_Logo.png && \
cp pvsneslib/pvsneslib_license.txt release/pvsneslib/pvsneslib/pvsneslib_license.txt && \
cp pvsneslib/pvsneslib_snesmod.txt release/pvsneslib/pvsneslib/pvsneslib_snesmod.txt && \
cp pvsneslib/pvsneslib_version.txt release/pvsneslib/pvsneslib/pvsneslib_version.txt && \
cp -r snes-examples release/pvsneslib/snes-examples && \
cd release && zip -r -m pvsneslib_32b_$(operatingSystem).zip pvsneslib && \
echo && echo Release created successfully ! && echo
.PHONY: all