build: fix clean targets on Windows

To get clean makefile targets working robustly under a Windows command
prompt, allow the entire contents of obj/out directories to be deleted.
They are now recreated by the build as needed.
このコミットが含まれているのは:
invertego 2022-04-23 02:48:01 -07:00 committed by Luke Usher
コミット c0dfad661b
17個のファイルの変更64行の追加51行の削除

2
.gitignore vendored ノーマルファイル
ファイルの表示

@ -0,0 +1,2 @@
obj/
out/

ファイルの表示

@ -1,6 +1,10 @@
build := stable
nall.path := ../../../nall
include $(nall.path)/GNUmakefile
all:
sourcery resource.bml resource.cpp resource.hpp
clean:
rm resource.cpp
rm resource.hpp
$(call delete,resource.cpp)
$(call delete,resource.hpp)

ファイルの表示

@ -71,7 +71,9 @@ $(object.path)/desktop-ui-tools.o: $(desktop-ui.path)/tools/tools.cpp
all.objects := $(libco.objects) $(sljit.objects) $(libchdr.objects) $(ruby.objects) $(hiro.objects) $(ares.objects) $(mia.objects) $(desktop-ui.objects)
all.options := $(libco.options) $(sljit.options) $(libchdr.options) $(ruby.options) $(hiro.options) $(ares.options) $(mia.options) $(desktop-ui.options) $(options)
all: $(all.objects)
$(all.objects): | $(object.path)
all: $(all.objects) | $(output.path)
$(info Linking $(output.path)/$(name) ...)
+@$(compiler) -o $(output.path)/$(name) $(all.objects) $(all.options)
$(call copy,../LICENSE,$(output.path)/LICENSE.txt)
@ -101,8 +103,8 @@ clean:
ifeq ($(platform),macos)
rm -rf $(output.path)/$(name).app
endif
$(call rdelete,$(object.path)/*)
$(call rdelete,$(output.path)/*)
$(call rdelete,$(object.path))
$(call rdelete,$(output.path))
install: all
ifeq ($(platform),windows)

ファイルの表示

@ -1,2 +0,0 @@
*
!.gitignore

ファイルの表示

@ -1,2 +0,0 @@
*
!.gitignore

ファイルの表示

@ -1,6 +1,10 @@
build := stable
nall.path := ../../nall
include $(nall.path)/GNUmakefile
all:
sourcery resource.bml resource.cpp resource.hpp
clean:
rm resource.cpp
rm resource.hpp
$(call delete,resource.cpp)
$(call delete,resource.hpp)

ファイルの表示

@ -9,40 +9,42 @@ hiro.path := ../hiro
hiro.resource := data/$(name).rc
include $(hiro.path)/GNUmakefile
objects := obj/genius.o
objects := $(object.path)/genius.o
obj/genius.o: genius.cpp
$(object.path)/genius.o: genius.cpp
all: $(hiro.objects) $(objects)
$(info Linking out/$(name) ...)
+@$(compiler) -o out/$(name) $(hiro.objects) $(objects) $(hiro.options) $(options)
$(objects): | $(object.path)
all: $(hiro.objects) $(objects) | $(output.path)
$(info Linking $(output.path)/$(name) ...)
+@$(compiler) -o $(output.path)/$(name) $(hiro.objects) $(objects) $(hiro.options) $(options)
ifeq ($(platform),macos)
rm -rf out/$(name).app
mkdir -p out/$(name).app/Contents/MacOS/
mkdir -p out/$(name).app/Contents/Resources/
mv out/$(name) out/$(name).app/Contents/MacOS/$(name)
cp data/$(name).plist out/$(name).app/Contents/Info.plist
sips -s format icns data/$(name).png --out out/$(name).app/Contents/Resources/$(name).icns
rm -rf $(output.path)/$(name).app
mkdir -p $(output.path)/$(name).app/Contents/MacOS/
mkdir -p $(output.path)/$(name).app/Contents/Resources/
mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
cp data/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
sips -s format icns data/$(name).png --$(output.path) $(output.path)/$(name).app/Contents/Resources/$(name).icns
endif
verbose: hiro.verbose nall.verbose all;
clean:
ifeq ($(platform),macos)
rm -rf out/$(name).app
rm -rf $(output.path)/$(name).app
endif
$(call delete,obj/*)
$(call delete,out/*)
$(call delete,$(object.path)/*)
$(call delete,$(output.path)/*)
install: all
ifeq ($(platform),macos)
cp -R out/$(name).app /Applications/$(name).app
cp -R $(output.path)/$(name).app /Applications/$(name).app
else ifneq ($(filter $(platform),linux bsd),)
mkdir -p $(prefix)/bin/
mkdir -p $(prefix)/share/applications/
mkdir -p $(prefix)/share/icons/
mkdir -p $(prefix)/share/$(name)/
cp out/$(name) $(prefix)/bin/$(name)
cp $(output.path)/$(name) $(prefix)/bin/$(name)
cp data/$(name).desktop $(prefix)/share/applications/$(name).desktop
cp data/$(name).png $(prefix)/share/icons/$(name).png
endif
@ -56,4 +58,4 @@ else ifneq ($(filter $(platform),linux bsd),)
rm -f $(prefix)/share/icons/$(name).png
endif
-include obj/*.d
-include $(object.path)/*.d

ファイルの表示

@ -1,2 +0,0 @@
*.o
*.d

ファイルの表示

@ -1 +0,0 @@
genius

ファイルの表示

@ -21,7 +21,9 @@ $(object.path)/ares.o: $(ares.path)/ares/ares.cpp
$(object.path)/mia.o: $(mia.path)/mia.cpp
$(object.path)/resource.o: $(mia.path)/resource/resource.cpp
all: $(hiro.objects) $(objects)
$(objects): | $(object.path)
all: $(hiro.objects) $(objects) | $(output.path)
$(info Linking $(output.path)/$(name) ...)
+@$(compiler) -o $(output.path)/$(name) $(hiro.objects) $(objects) $(hiro.options) $(options)
ifeq ($(platform),macos)

2
mia/obj/.gitignore vendored
ファイルの表示

@ -1,2 +0,0 @@
*
!.gitignore

2
mia/out/.gitignore vendored
ファイルの表示

@ -1,2 +0,0 @@
*
!.gitignore

ファイルの表示

@ -1,6 +1,10 @@
build := stable
nall.path := ../../nall
include $(nall.path)/GNUmakefile
all:
sourcery resource.bml resource.cpp resource.hpp
clean:
rm resource.cpp
rm resource.hpp
$(call delete,resource.cpp)
$(call delete,resource.hpp)

ファイルの表示

@ -44,7 +44,7 @@ ifeq ($(shell echo ^^),^)
copy = @copy $(call fixpath,$1) $(call fixpath,$2)
rcopy = @xcopy /e /q /y $(call fixpath,$1) $(call fixpath,$2)
delete = $(info Deleting $1 ...) @del /q $(call fixpath,$1)
rdelete = $(info Deleting $1 ...) @del /s /q $(call fixpath,$1) && if exist $(call fixpath,$1) (rmdir /s /q $(call fixpath,$1))
rdelete = $(info Deleting $1 ...) @if exist $(call fixpath,$1) (rmdir /s /q $(call fixpath,$1))
else
# sh
mkdir = @mkdir -p $1
@ -214,6 +214,12 @@ nall.verbose:
$(info Compiling $(subst ../,,$<) ...)
@$(call compile)
$(object.path):
$(call mkdir,$(object.path))
$(output.path):
$(call mkdir,$(output.path))
# function compile([arguments])
compile = \
$(strip \

ファイルの表示

@ -5,23 +5,25 @@ flags += -I..
nall.path := ../nall
include $(nall.path)/GNUmakefile
objects := obj/sourcery.o
objects := $(object.path)/sourcery.o
obj/sourcery.o: sourcery.cpp
$(object.path)/sourcery.o: sourcery.cpp
all: $(objects)
$(info Linking out/$(name) ...)
+@$(compiler) -o out/$(name) $(objects) $(options)
$(objects): | $(object.path)
all: $(objects) | $(output.path)
$(info Linking $(output.path)/$(name) ...)
+@$(compiler) -o $(output.path)/$(name) $(objects) $(options)
verbose: nall.verbose all;
clean:
$(call delete,obj/*)
$(call delete,out/*)
$(call delete,$(object.path)/*)
$(call delete,$(output.path)/*)
install: all
ifneq ($(filter $(platform),linux bsd),)
cp out/$(name) $(prefix)/bin/$(name)
cp $(output.path)/$(name) $(prefix)/bin/$(name)
endif
uninstall:

ファイルの表示

@ -1,2 +0,0 @@
*
!.gitignore

ファイルの表示

@ -1,2 +0,0 @@
*
!.gitignore