diff --git a/.gitignore b/.gitignore index a7874e6..32210f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .directory /build -release* +/image/* +/patchwork diff --git a/Makefile b/Makefile index dbf4b59..45cd0ed 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,36 @@ 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 $@ $^ -patch/tree patch/work: - mkdir $@ -patch/tree/map: patch/tree - mkdir $@ -patch/work/map_definition.csv: $(VANILLA_SRC)/map/definition.csv | patch/work - cp -v $< $@ -patch/tree/map/definition.csv: patch/work/map_definition.csv patch/patches/map_definition.patch | patch/tree/map - patch -u --binary -N $^ - cp -v $< $@ - -clean: - rm -rf patch/tree patch/work release.zip build - -release: build release.zip +#build +raw_requsites := src/* +patched_requisites := patchwork/map/definition.csv build: mkdir $@ +release: build/release.zip -raw_requsites := common descriptor.mod gfx history interface localisation -patched_requisites := patch/tree/map -build/randchgs: $(raw_requsites) $(patched_requisites) | build +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 $@ - cp -r -t $@ $(raw_requsites) - cp -r -t $@ $(patched_requisites) +$(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)"' >> $@ -release.zip: build/randchgs - zip -r $@ build -.PHONY: all release clean +#clean +clean: + rm -rf patchwork build image +.PHONY: all release clean patch install diff --git a/patch/.gitignore b/patch/.gitignore deleted file mode 100644 index 350fa93..0000000 --- a/patch/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/work -/tree diff --git a/patch/patches/map_definition.patch b/patches/map_definition.patch similarity index 100% rename from patch/patches/map_definition.patch rename to patches/map_definition.patch diff --git a/patches/terrain.bmp b/patches/terrain.bmp new file mode 100644 index 0000000..1d3c2bc Binary files /dev/null and b/patches/terrain.bmp differ diff --git a/common/characters/Ben-Gurion.txt b/src/common/characters/Ben-Gurion.txt similarity index 100% rename from common/characters/Ben-Gurion.txt rename to src/common/characters/Ben-Gurion.txt diff --git a/descriptor.mod b/src/descriptor.mod similarity index 100% rename from descriptor.mod rename to src/descriptor.mod diff --git a/gfx/leaders/ARG/Portrait_Argentina_Fanny_Edelman.dds b/src/gfx/leaders/ARG/Portrait_Argentina_Fanny_Edelman.dds similarity index 100% rename from gfx/leaders/ARG/Portrait_Argentina_Fanny_Edelman.dds rename to src/gfx/leaders/ARG/Portrait_Argentina_Fanny_Edelman.dds diff --git a/gfx/leaders/ISR/ISR_Democrat.dds b/src/gfx/leaders/ISR/ISR_Democrat.dds similarity index 100% rename from gfx/leaders/ISR/ISR_Democrat.dds rename to src/gfx/leaders/ISR/ISR_Democrat.dds diff --git a/history/countries/ISR - Israel.txt b/src/history/countries/ISR - Israel.txt similarity index 100% rename from history/countries/ISR - Israel.txt rename to src/history/countries/ISR - Israel.txt diff --git a/history/states/454-Israel.txt b/src/history/states/454-Israel.txt similarity index 100% rename from history/states/454-Israel.txt rename to src/history/states/454-Israel.txt diff --git a/interface/ISR.gfx b/src/interface/ISR.gfx similarity index 100% rename from interface/ISR.gfx rename to src/interface/ISR.gfx diff --git a/localisation/russian/parties2_l_russian.yml b/src/localisation/russian/parties2_l_russian.yml similarity index 100% rename from localisation/russian/parties2_l_russian.yml rename to src/localisation/russian/parties2_l_russian.yml diff --git a/localisation/russian/victory_points2_l_russian.yml b/src/localisation/russian/victory_points2_l_russian.yml similarity index 100% rename from localisation/russian/victory_points2_l_russian.yml rename to src/localisation/russian/victory_points2_l_russian.yml