mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Read version from script_mod.hpp, Define PREFIX and ZIP
This commit is contained in:
parent
7f9add4a04
commit
c91a37e6cc
39
Makefile
39
Makefile
@ -1,40 +1,47 @@
|
||||
VERSION = 3.5.1
|
||||
BIN = @ace
|
||||
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
|
||||
CBA = tools/cba
|
||||
FLAGS = -i $(CBA) -w unquoted-string
|
||||
|
||||
$(BIN)/addons/ace_%.pbo: addons/%
|
||||
$(BIN)/addons/$(PREFIX)_%.pbo: addons/%
|
||||
@mkdir -p $(BIN)/addons
|
||||
@echo " PBO $@"
|
||||
@armake build ${FLAGS} -f $< $@
|
||||
|
||||
$(BIN)/optionals/ace_%.pbo: optionals/%
|
||||
$(BIN)/optionals/$(PREFIX)_%.pbo: optionals/%
|
||||
@mkdir -p $(BIN)/optionals
|
||||
@echo " PBO $@"
|
||||
@armake build ${FLAGS} -f $< $@
|
||||
|
||||
# This is a shortcut for building single addons, so you can just call "make medical.pbo"
|
||||
# Shortcut for building single addons (eg. "make <component>.pbo")
|
||||
%.pbo:
|
||||
make $(patsubst %, $(BIN)/addons/ace_%, $@)
|
||||
make $(patsubst %, $(BIN)/addons/$(PREFIX)_%, $@)
|
||||
|
||||
all: $(patsubst addons/%, $(BIN)/addons/ace_%.pbo, $(wildcard addons/*)) \
|
||||
$(patsubst optionals/%, $(BIN)/optionals/ace_%.pbo, $(wildcard optionals/*))
|
||||
all: $(patsubst addons/%, $(BIN)/addons/$(PREFIX)_%.pbo, $(wildcard addons/*)) \
|
||||
$(patsubst optionals/%, $(BIN)/optionals/$(PREFIX)_%.pbo, $(wildcard optionals/*))
|
||||
|
||||
$(BIN)/keys/%.biprivatekey:
|
||||
@mkdir -p $(BIN)/keys
|
||||
@echo " KEY $@"
|
||||
@armake keygen -f $(patsubst $(BIN)/keys/%.biprivatekey, $(BIN)/keys/%, $@)
|
||||
|
||||
$(BIN)/addons/ace_%.pbo.ace_$(VERSION).bisign: $(BIN)/addons/ace_%.pbo $(BIN)/keys/ace_$(VERSION).biprivatekey
|
||||
$(BIN)/addons/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION_FULL).bisign: $(BIN)/addons/$(PREFIX)_%.pbo $(BIN)/keys/$(PREFIX)_$(VERSION_FULL).biprivatekey
|
||||
@echo " SIG $@"
|
||||
@armake sign -f $(BIN)/keys/ace_$(VERSION).biprivatekey $<
|
||||
@armake sign -f $(BIN)/keys/ace_$(VERSION_FULL).biprivatekey $<
|
||||
|
||||
$(BIN)/optionals/ace_%.pbo.ace_$(VERSION).bisign: $(BIN)/optionals/ace_%.pbo $(BIN)/keys/ace_$(VERSION).biprivatekey
|
||||
$(BIN)/optionals/$(PREFIX)_%.pbo.$(PREFIX)_$(VERSION_FULL).bisign: $(BIN)/optionals/$(PREFIX)_%.pbo $(BIN)/keys/$(PREFIX)_$(VERSION_FULL).biprivatekey
|
||||
@echo " SIG $@"
|
||||
@armake sign -f $(BIN)/keys/ace_$(VERSION).biprivatekey $<
|
||||
@armake sign -f $(BIN)/keys/$(PREFIX)_$(VERSION_FULL).biprivatekey $<
|
||||
|
||||
signatures: $(patsubst addons/%, $(BIN)/addons/ace_%.pbo.ace_$(VERSION).bisign, $(wildcard addons/*)) \
|
||||
$(patsubst optionals/%, $(BIN)/optionals/ace_%.pbo.ace_$(VERSION).bisign, $(wildcard optionals/*))
|
||||
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/*))
|
||||
|
||||
extensions: $(wildcard extensions/*/*)
|
||||
cd extensions/build && cmake .. && make
|
||||
@ -44,10 +51,10 @@ extensions-win64: $(wildcard extensions/*/*)
|
||||
cd extensions/build && CXX=$(eval $(which g++-w64-mingw-i686)) cmake .. && make
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN) ace3_*.zip
|
||||
rm -rf $(BIN) $(ZIP)_*.zip
|
||||
|
||||
release: clean signatures
|
||||
@rm $(BIN)/keys/*.biprivatekey
|
||||
@echo " ZIP ace3_$(VERSION).zip"
|
||||
@cp *.dll LICENSE README.md AUTHORS.txt logo_ace3_ca.paa mod.cpp meta.cpp $(BIN)
|
||||
@zip -r ace3_$(VERSION).zip @ace &> /dev/null
|
||||
@zip -r $(ZIP)_$(VERSION).zip $(BIN) &> /dev/null
|
||||
|
Loading…
Reference in New Issue
Block a user