forked from stelic/limitload
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
47 lines (38 loc) · 1.18 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
util_dir := ../util
build_env := $(shell grep 'build_env=' $(util_dir)/build_setup | sed 's/.*=//')
python_cmd := $(shell grep 'python_cmd=' $(util_dir)/build_setup | sed 's/.*=//')
binname := limload
pyc_files := $(shell find -name '*.py' | sort | sed 's:\.py$$:\.pyc:')
all: \
subdir-core \
../$(binname) \
bconf.pyc \
$(pyc_files) \
../$(binname): $(binname).cpp $(binname).ico
ifeq ($(build_env), lingcc)
g++ -D LINGCC -D PYTHON_CMD='"$(python_cmd)"' $(binname).cpp
mv a.out ../$(binname)
else ifeq ($(build_env), winmsvc)
echo '101 ICON "$(binname).ico"' > resource.rc
rc -fo resource.res resource.rc
cvtres -machine:x64 -out:resource.obj resource.res
cl -D WINMSVC -D PYTHON_CMD='"$(python_cmd)"' $(binname).cpp resource.obj
mv $(binname).exe ../
rm -f $(binname).obj resource.obj resource.res resource.rc
endif
bconf.py: bconf.py.in ../util/build_setup
cat $< \
| sed "s/@python_cmd@/$(python_cmd)/g" \
> $@
%.pyc: %.py
$(python_cmd) -m py_compile $<
subdir-core:
@$(MAKE) -C core
clean:
@$(MAKE) clean -C core
ifeq ($(build_env), lingcc)
rm -f ../$(binname)
else ifeq ($(build_env), winmsvc)
rm -f ../$(binname).exe
endif
find -name \*.pyc | xargs -r rm