37 lines
1.0 KiB
Makefile
37 lines
1.0 KiB
Makefile
all: patch/tree/map/definition.csv
|
|
|
|
# patch
|
|
VANILLA_SRC ?= ../vanilla
|
|
patchwork/map/definition.csv: $(VANILLA_SRC)/map/definition.csv patches/map_definition.patch
|
|
mkdir -p $(@D)
|
|
patch -u --binary -N -o $@ $^
|
|
|
|
#build
|
|
raw_requsites := src/*
|
|
patched_requisites := patchwork/map/definition.csv
|
|
build:
|
|
mkdir $@
|
|
release: build/release.zip
|
|
|
|
build/release.zip: src/* $(patched_requisites) | build
|
|
cd src && zip -r ../build/$(@F) ./
|
|
cd patchwork && zip -r ../build/$(@F) ./
|
|
|
|
# install
|
|
DESTDIR ?= image
|
|
MODNAME ?= randchgs
|
|
MODPATH ?= C:/Users/User/Documents/Paradox Interactive/Hearts of Iron IV/mod/randchgs
|
|
install: $(DESTDIR)/$(MODNAME).mod | $(DESTDIR)/$(MODNAME)
|
|
$(DESTDIR)/$(MODNAME) $(DESTDIR):
|
|
mkdir -p $@
|
|
$(DESTDIR)/$(MODNAME)/descriptor.mod: build/release.zip | $(DESTDIR)/$(MODNAME)
|
|
cd $| && unzip -o $(abspath build/release.zip)
|
|
$(DESTDIR)/$(MODNAME).mod: $(DESTDIR)/$(MODNAME)/descriptor.mod
|
|
cp $< $@
|
|
printf '\n%s\n' 'path="$(MODPATH)/$(MODNAME)"' >> $@
|
|
|
|
#clean
|
|
clean:
|
|
rm -rf patchwork build image
|
|
.PHONY: all release clean patch install
|