Makefile Improvements

The clobber target has been removed and the clean target now does what most people would expect (actually cleans the entire build tree).
This commit is contained in:
Wayne Warthen
2022-07-06 16:39:03 -07:00
parent 0c61385df4
commit d241db5c11
19 changed files with 29 additions and 56 deletions

View File

@@ -24,7 +24,6 @@ jobs:
sudo apt-get install libncurses-dev
sudo apt-get install srecord
make dist
make clean
rm -rf .git*
- name: List Output
@@ -64,7 +63,6 @@ jobs:
export TZ='America/Los_Angeles'
brew install srecord
make dist
make clean
rm -rf .git*
- name: List Output

View File

@@ -27,7 +27,6 @@ jobs:
run: |
sudo apt-get install libncurses-dev
make dist
make clean
rm -rf .git*
- name: Upload Artifact

View File

@@ -7,5 +7,5 @@ include $(TOOLS)/Makefile.inc
all::
mkdir -p Tunes
clobber::
clean::
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.ovr *.hlp *.doc *.COM *.BIN Tunes/*.mym Tunes/*.pt? Tunes/*.vgm

View File

@@ -3,5 +3,5 @@ MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.com)
include $(TOOLS)/Makefile.inc
clobber::
clean::
@rm -f *.com

View File

@@ -3,5 +3,5 @@ MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr)
include $(TOOLS)/Makefile.inc
clobber::
@rm -f *.spr
clean::
@rm -f *.spr *.com *.sys *.dat cpm3fix.pat readme.1st

View File

@@ -4,5 +4,5 @@ SUBDIRS = Apps CPM3 ZPM3
include $(TOOLS)/Makefile.inc
clobber::
@rm -f *.bin *.com *.img *.rom *.upd *.hex *.pdf *.log *.eeprom *.dat
clean::
@rm -f *.bin *.com *.img *.rom *.upd *.hex *.pdf *.log *.eeprom *.dat

View File

@@ -3,5 +3,5 @@ MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr)
include $(TOOLS)/Makefile.inc
clobber::
@rm -f *.spr
clean::
@rm -f *.spr *.com *.sys *.dat *.zpm

View File

@@ -1,20 +1,18 @@
all:
$(MAKE) --directory Tools/unix
$(MAKE) --directory Tools
$(MAKE) --directory Source
clean:
$(MAKE) --directory Tools/unix clean
$(MAKE) --directory Tools clean
$(MAKE) --directory Source clean
$(MAKE) --directory Binary clean
clobber:
$(MAKE) --directory Tools/unix clobber
$(MAKE) --directory Source clobber
$(MAKE) --directory Binary clobber
rm -f typescript
clobber: clean
diff:
$(MAKE) --directory Source diff
dist:
$(MAKE) ROM_PLATFORM=dist
$(MAKE) --directory Source clean
$(MAKE) --directory Tools clean

View File

@@ -47,9 +47,8 @@ the "SCZ180" platform:
Please be aware that the make-based build does have a few deficiencies.
First and most important, the Makefiles do not handle reruns very well.
To ensure a full buld, use "make clobber" from the top level directory
before running the actual build. For those used to using "make clean",
you can do that but it is not as thorough as "make clobber".
To ensure a full buld, use "make clean" from the top level directory
before running the actual build.
Second, there are some build failures that will not stop the make
process. Most of this is because real CP/M 2.2 tools are used in
@@ -57,7 +56,7 @@ places and CP/M 2.2 does not allow programs to return a result code.
Third, not all dependencies are properly handled. So, changes to some
files will not cause things to rebuild as appropriate. In general, I
recommend doing a "make clobber" before running "make" to ensure that
recommend doing a "make clean" before running "make" to ensure that
everything is fully rebuilt.
For macOS users, you may encounter a failure reading or writing files.

View File

@@ -30,7 +30,7 @@ zcpr33n.rel zcpr33t.rel:
all:: $(HD0IMG)
clobber::
clean::
@rm -f $(HD0IMG)
%.img: zcpr33n.rel zcpr33t.rel

11
Tools/Makefile Normal file
View File

@@ -0,0 +1,11 @@
#
# build the tools for linux and Darwin
#
UNAME := $(shell uname)
all:
$(MAKE) --directory unix
clean:
$(MAKE) --directory unix clean
@rm -rf $(UNAME)

View File

@@ -156,13 +156,7 @@ clean::
done
clobber:: clean
@if [ "$(DEST)" ] ; then for file in $(OBJECTS) ; do \
rm -f $$($(CASEFN) $(DEST)/$$file) ; \
done ; fi
@-rm -f $$($(CASEFN) $(filter-out $(NODELETE),$(OBJECTS)))
@for dir in $(SUBDIRS) ; do \
$(MAKE) --directory $$dir clobber ; \
done
#
# this is used to verify that the unix and windows tool chains are generating
# the same objects

View File

@@ -15,9 +15,5 @@ all:
@chmod +x casefn.sh
@$(foreach subdir,$(SUBDIRS),$(MAKE) --directory $(subdir) all;)
clobber:
@$(foreach subdir,$(SUBDIRS),$(MAKE) --directory $(subdir) clobber;)
@rm -rf ../$(UNAME)
clean:
@$(foreach subdir,$(SUBDIRS),$(MAKE) --directory $(subdir) clean;)

View File

@@ -18,9 +18,6 @@ $(DEST):
clean:
rm -f $(OBJ_FILES) $(BINARY)
clobber: clean
rm -f $(DEST)/$(BINARY) $(BINARY)
$(BINARY): $(OBJ_FILES)
$(CC) -o $@ $^ $(LIBS)

View File

@@ -20,9 +20,4 @@ all: $(DEST)
$(DEST):
mkdir $(DEST)
clobber: clean
-for i in *.$(SUFFIX) ; do \
rm $(DEST)/$$(basename $$i .$(SUFFIX)) ; \
done
clean:

View File

@@ -54,8 +54,3 @@ $(DEST):
clean:
-rm -f *.o $(OBJECTS)
clobber: clean
-for i in $(OBJECTS) ; do \
rm -f $(DEST)/$$i ; \
done

View File

@@ -41,6 +41,3 @@ $(APP): $(OBJS)
clean:
@rm -rf $(APP) $(OBJDIR)
clobber: clean
rm -f ../../$(UNAME)/$(APP)

View File

@@ -49,9 +49,6 @@ all: uz80as $(DEST)
$(DEST):
mkdir -p $(DEST)
clobber: clean
-rm -f uz80as $(DEST)/uz80as
clean:
-rm -f $(OBJECTS) uz80as

View File

@@ -25,9 +25,6 @@ $(DEST):
clean:
-rm -f $(OBJECTS) config.h zxcc bios.bin
clobber: clean
-rm -f $(DEST)/zxcc $(DEST)/bios.bin zxcc
$(OBJECTS): config.h bios.bin
zxcc: $(OBJECTS)