-
Notifications
You must be signed in to change notification settings - Fork 0
/
.submakefiles
44 lines (35 loc) · 1.6 KB
/
.submakefiles
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
include ../.makefiles
MOD_ASSETS = tmp/$(ASSETS)/au_$(MOD)
WITH_APIS = $(shell cat ../.tmp_with-apis)
CPP_DEFINES = $(WITH_APIS) -DMC$(VER) -DTHIS_MOD=$(AUMOD)
CPP_FLAGS = -E -P $(CPP_DEFINES) -include ../../includes.h
ifeq ($(DEBUG),1)
CPP_DEFINES := $(CPP_DEFINES) -DDEBUG
endif
all:
@echo "Syntax: make <prepare|jar|clean>"
prepare:
@mkdir -p tmp
@mkdir -p $(SRC)/com/qzx/au/$(MOD)
@(cd src; for j in *.java; do cpp $(CPP_FLAGS) -o $(SRC)/com/qzx/au/$(MOD)/$$j $$j; done)
@(cd src; for d in *; do if [ -d "$$d" ]; then mkdir $(SRC)/com/qzx/au/$(MOD)/$$d; for j in $$d/*.java; do cpp $(CPP_FLAGS) -o $(SRC)/com/qzx/au/$(MOD)/$$j $$j; done; fi; done)
@../.only_with.sh $(SRC)/com/qzx/au/$(MOD) $(VER) $(SUPPORT_BLOCKS)
ifeq ($(GRADLE),yes)
@(if [ -f "at.cfg" ]; then cp at.cfg $(AT)/$(AUMOD)_at.cfg; cp at.cfg tmp/$(AUMOD)_at.cfg; fi)
endif
ifdef DEBUG
@(cp ../Debug.java $(SRC)/com/qzx/au/$(MOD)/)
@(sed -E -i "s:MOD_LOWER:$(MOD):" $(SRC)/com/qzx/au/$(MOD)/Debug.java)
@(sed -E -i "s:AUMOD:$(AUMOD):" $(SRC)/com/qzx/au/$(MOD)/Debug.java)
endif
@(cp mcmod.info tmp/mcmod.info)
@(sed -E -i "s: modVersion = \"0.0.0\": modVersion = \"$(VER)-$(NOW)\":" $(SRC)/com/qzx/au/$(MOD)/$(AUMOD).java)
@(sed -E -i "s:\"version\"\: \"0.0.0\":\"version\"\: \"$(VER)-$(NOW)\":" tmp/mcmod.info)
@(sed -E -i "s:\"mcversion\"\: \"0.0.0\":\"mcversion\"\: \"$(DOTVER)\":" tmp/mcmod.info)
ifeq ($(GRADLE),yes)
@(sed -E -i "s:\"authors\"\::\"authorList\"\::" tmp/mcmod.info)
endif
@mkdir -p $(MOD_ASSETS)
@(if [ -d "lang" ]; then mkdir $(MOD_ASSETS)/lang ; cp lang/*.lang $(MOD_ASSETS)/lang; fi)
clean:
rm -rf au_$(MOD)-*.zip tmp