Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit be2a220

Browse files
committed
build: improve the clean target
* Uses a sentinel file for the obj directory. * Removes the binary with 'make clean'. * Uses 'rm -f` to ensure the clean target always succeeds.
1 parent 76c5e02 commit be2a220

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,18 @@ ifeq ($(TARGET),gtk)
8383
endif
8484

8585
all: $(FNAME_$(TARGET))
86-
obj:
87-
mkdir obj
88-
clean: | obj
89-
rm obj/* || true
86+
87+
obj/.tag:
88+
@mkdir -p obj
89+
@touch $@
90+
91+
clean:
92+
rm -rf obj/
93+
rm -f $(FNAME_$(TARGET))
9094

9195
ifeq ($(TARGET),windows)
9296
XFILES += obj/rc.o
93-
obj/rc.o: flips.rc flips.h | obj
97+
obj/rc.o: flips.rc flips.h obj/.tag
9498
windres flips.rc obj/rc.o
9599
endif
96100

0 commit comments

Comments
 (0)