From 4019f8b963f475601b0a2e65ab8ebe58b0f86e3d Mon Sep 17 00:00:00 2001 From: Mark Kim Date: Sun, 27 Dec 2020 23:12:46 -0500 Subject: [PATCH] Create Resources directory dynamically at compile time The 'Resources' directory is used in macOS development to test the binary without building TuxPaint.app bundle, which is helpful for rapid application development since creating the app bundle takes a long time. It's been reported that the symlink in the Resources directory was causing the 'release' target to copy the files in the 'data' directory twice into the source release tarball. This change removes the static Resources directory but creates it dynamically when the 'tuxpaint' target is built and removes it via 'clean' target so the 'release' target does not copy the files in the 'data' directory into the source release tarball twice. --- Makefile | 6 +++++- Resources/README.txt | 24 ------------------------ Resources/share/tuxpaint | 1 - 3 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 Resources/README.txt delete mode 120000 Resources/share/tuxpaint diff --git a/Makefile b/Makefile index 1acc993d6..ce16808a2 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,9 @@ RSRC_CMD:=$($(OS)_RSRC_CMD) beos_MIMESET_CMD:=mimeset -f tuxpaint MIMESET_CMD:=$($(OS)_MIMESET_CMD) +macos_RAD_CMD:=[[ ! -d Resources/share ]] && mkdir -p Resources/share && ln -s ../../data Resources/share/tuxpaint || : +RAD_CMD:=$($(OS)_RAD_CMD) + windows_SO_TYPE:=dll macos_SO_TYPE:=dylib beos_SO_TYPE:=so @@ -607,7 +610,7 @@ clean: @-rm -f templates/.thumbs/*.png @if [ -d templates/.thumbs ]; then rmdir templates/.thumbs; fi @-if [ "x$(BUNDLE)" != "x" ]; then rm -rf $(BUNDLE); fi - @-rm -f TuxPaint.dmg temp.dmg; rm -rf magic/*.dSYM + @-rm -f TuxPaint.dmg temp.dmg; rm -rf magic/*.dSYM Resources @echo # "make uninstall" should remove the various parts from their @@ -1052,6 +1055,7 @@ tuxpaint: obj/tuxpaint.o obj/i18n.o obj/im.o obj/cursor.o obj/pixels.o \ $(CC) $(CFLAGS) $(LDFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(FRIBIDI_CFLAGS) $(DEFS) \ -o tuxpaint $^ \ $(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS) + @$(RAD_CMD) @$(RSRC_CMD) @$(MIMESET_CMD) diff --git a/Resources/README.txt b/Resources/README.txt deleted file mode 100644 index 03e7c34e5..000000000 --- a/Resources/README.txt +++ /dev/null @@ -1,24 +0,0 @@ -This folder exists to ease testing under macOS. Please ignore but do not -delete. More details are below. - -macOS requires all files in an application have a specific folder structure. -We create this structure under the folder "TuxPaint.app" when `make install` is -run. But `make install` takes a long time to run under macOS due to the large -number of files that need to be copied, as well as all the processing we do to -those files (see custom/macos.sh for what we need to do.) This makes testing -even a small code change time consuming. - -That's the problem this folder solves: Instead of creating the folder -structure under TuxPaint.app every time to test a code change to be able to run -the application, we pre-build the folder structure around the tuxpaint binary -so the binary can be executed directly without re-creating the folder structure -every time. Luckily for us, this only require that we only have a single -folder "Resources" in the root folder of the tuxpaint source code (with some -subfolders and symlinks underneath the Resources folder.) - -I hope my fellow Tux Paint contributors will forgive me for taking up yet -another whole folder for use by a single platform, let alone almost empty, in -the root folder of the source code distribution meant for multiple platforms. - -Mark Kim -2018.06.27 diff --git a/Resources/share/tuxpaint b/Resources/share/tuxpaint deleted file mode 120000 index e67b45590..000000000 --- a/Resources/share/tuxpaint +++ /dev/null @@ -1 +0,0 @@ -../../data \ No newline at end of file