2016-05-22 15:40:50 +00:00
|
|
|
MAJOR = $(shell grep "^\#define[[:space:]]*MAJOR" addons/main/script_mod.hpp | egrep -m 1 -o '[[:digit:]]+')
|
|
|
|
MINOR = $(shell grep "^\#define[[:space:]]*MINOR" addons/main/script_mod.hpp | egrep -m 1 -o '[[:digit:]]+')
|
|
|
|
PATCH = $(shell grep "^\#define[[:space:]]*PATCHLVL" addons/main/script_mod.hpp | egrep -m 1 -o '[[:digit:]]+')
|
|
|
|
BUILD = $(shell grep "^\#define[[:space:]]*BUILD" addons/main/script_mod.hpp | egrep -m 1 -o '[[:digit:]]+')
|
|
|
|
VERSION = $(MAJOR).$(MINOR).$(PATCH)
|
|
|
|
VERSION_FULL = $(VERSION).$(BUILD)
|
|
|
|
PREFIX = ace
|
|
|
|
BIN = @ace
|
|
|
|
ZIP = ace3
|
2016-05-15 16:21:23 +00:00
|
|
|
CBA = tools/cba
|
|
|
|
FLAGS = -i $(CBA) -w unquoted-string
|
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
$(BIN)/addons/$(PREFIX)_%.pbo: addons/%
|
2016-05-15 16:21:23 +00:00
|
|
|
@mkdir -p $(BIN)/addons
|
2016-05-02 14:39:47 +00:00
|
|
|
@echo " PBO $@"
|
2016-05-02 14:49:33 +00:00
|
|
|
@armake build ${FLAGS} -f $< $@
|
2016-05-02 14:39:47 +00:00
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
$(BIN)/optionals/$(PREFIX)_%.pbo: optionals/%
|
2016-05-15 16:21:23 +00:00
|
|
|
@mkdir -p $(BIN)/optionals
|
|
|
|
@echo " PBO $@"
|
|
|
|
@armake build ${FLAGS} -f $< $@
|
2016-05-02 14:39:47 +00:00
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
# Shortcut for building single addons (eg. "make <component>.pbo")
|
2016-05-15 16:21:23 +00:00
|
|
|
%.pbo:
|
2016-05-22 15:40:50 +00:00
|
|
|
make $(patsubst %, $(BIN)/addons/$(PREFIX)_%, $@)
|
2016-05-15 16:21:23 +00:00
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
all: $(patsubst addons/%, $(BIN)/addons/$(PREFIX)_%.pbo, $(wildcard addons/*)) \
|
|
|
|
$(patsubst optionals/%, $(BIN)/optionals/$(PREFIX)_%.pbo, $(wildcard optionals/*))
|
2016-05-02 14:39:47 +00:00
|
|
|
|
2016-05-21 14:21:51 +00:00
|
|
|
$(BIN)/keys/%.biprivatekey:
|
|
|
|
@mkdir -p $(BIN)/keys
|
|
|
|
@echo " KEY $@"
|
|
|
|
@armake keygen -f $(patsubst $(BIN)/keys/%.biprivatekey, $(BIN)/keys/%, $@)
|
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
$(BIN)/addons/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION_FULL).bisign: $(BIN)/addons/$(PREFIX)_%.pbo $(BIN)/keys/$(PREFIX)_$(VERSION_FULL).biprivatekey
|
2016-05-21 14:21:51 +00:00
|
|
|
@echo " SIG $@"
|
2016-05-22 15:40:50 +00:00
|
|
|
@armake sign -f $(BIN)/keys/ace_$(VERSION_FULL).biprivatekey $<
|
2016-05-21 14:21:51 +00:00
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
$(BIN)/optionals/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION_FULL).bisign: $(BIN)/optionals/$(PREFIX)_%.pbo $(BIN)/keys/$(PREFIX)_$(VERSION_FULL).biprivatekey
|
2016-05-21 14:21:51 +00:00
|
|
|
@echo " SIG $@"
|
2016-05-22 15:40:50 +00:00
|
|
|
@armake sign -f $(BIN)/keys/$(PREFIX)_$(VERSION_FULL).biprivatekey $<
|
2016-05-21 14:21:51 +00:00
|
|
|
|
2016-05-22 15:40:50 +00:00
|
|
|
signatures: $(patsubst addons/%, $(BIN)/addons/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION_FULL).bisign, $(wildcard addons/*)) \
|
|
|
|
$(patsubst optionals/%, $(BIN)/optionals/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION_FULL).bisign, $(wildcard optionals/*))
|
2016-05-21 14:21:51 +00:00
|
|
|
|
2016-05-02 14:39:47 +00:00
|
|
|
extensions: $(wildcard extensions/*/*)
|
|
|
|
cd extensions/build && cmake .. && make
|
|
|
|
find ./extensions/build/ \( -name "*.so" -o -name "*.dll" \) -exec cp {} ./ \;
|
|
|
|
|
|
|
|
extensions-win64: $(wildcard extensions/*/*)
|
|
|
|
cd extensions/build && CXX=$(eval $(which g++-w64-mingw-i686)) cmake .. && make
|
|
|
|
|
2016-05-15 16:21:23 +00:00
|
|
|
clean:
|
2016-05-22 15:40:50 +00:00
|
|
|
rm -rf $(BIN) $(ZIP)_*.zip
|
2016-05-15 16:21:23 +00:00
|
|
|
|
2016-05-21 14:21:51 +00:00
|
|
|
release: clean signatures
|
2016-05-21 14:28:39 +00:00
|
|
|
@rm $(BIN)/keys/*.biprivatekey
|
2016-05-15 16:21:23 +00:00
|
|
|
@echo " ZIP ace3_$(VERSION).zip"
|
|
|
|
@cp *.dll LICENSE README.md AUTHORS.txt logo_ace3_ca.paa mod.cpp meta.cpp $(BIN)
|
2016-05-22 15:40:50 +00:00
|
|
|
@zip -r $(ZIP)_$(VERSION).zip $(BIN) &> /dev/null
|