aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTeddy Wing2023-09-05 01:39:02 +0200
committerTeddy Wing2023-09-05 01:39:02 +0200
commit7f21eec43ee50fe784f20e38019496665b1cbd30 (patch)
tree3f6e692abfe56268aab91c4bc0e04d3d7ab1b1ed /Makefile
parentb04d91ed2f8e391e506b7ee32bf499d2fbf2dbe8 (diff)
downloadBase-Windowed-Application-7f21eec43ee50fe784f20e38019496665b1cbd30.tar.bz2
Makefile: Adjust no-space rules so we don't rebuild every run
Now, `make app` doesn't error and says "Nothing to be done" when there are no changes. I adjusted the recipes to make the final bundle with spaces dependent on all files in the no-space bundle. Switch to `rsync` from `cp` so only the files that did change are copied. When updating the MacOS binary file, don't move it, otherwise that triggers a recompile. Instead copy it to the with-spaces .app bundle. We also need to remove the no-spaces version of the executable from the with-spaces .app bundle. Now I need to work out how to make all this work on application names that don't have spaces in them.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 5456bd7..f2fb483 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@ APP_NAME := Base\ Windowed\ Application
NBSP := $(shell perl -C -e 'print chr 0xfeff')
APP_NAME_NOSPACE := $(subst \ ,$(NBSP),$(APP_NAME))
+NOSPACE_BUNDLE_FILES = $(shell find build/$(APP_NAME_NOSPACE).app -type f)
testnospace:
echo $(APP_NAME_NOSPACE)
@@ -33,12 +34,15 @@ $(PRODUCT): $(OBJECTS) | build
build:
mkdir -p build
-build/$(APP_NAME).app: build/$(APP_NAME_NOSPACE).app
- cp -R $< "${@}"
+# build/$(APP_NAME).app: build/$(APP_NAME_NOSPACE).app
+# cp -R $< "${@}"
+build/$(APP_NAME).app: $(NOSPACE_BUNDLE_FILES)
+ rsync -rupE build/$(APP_NAME_NOSPACE).app/ "${@}/"
build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME): \
-build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME_NOSPACE)
- mv "${<}" "${@}"
+build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE)
+ cp -a "${<}" "${@}"
+ rm -f build/$(APP_NAME).app/Contents/MacOS/$(APP_NAME_NOSPACE)
# build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME): \
# build/$(APP_NAME_NOSPACE).app/Contents/MacOS/$(APP_NAME_NOSPACE)