changeset 2688:b42f00a3a937 default tip

Fix default target. Ensure m68k.h and z80.h are built before anything else when no dep info is available
author Michael Pavone <pavone@retrodev.com>
date Mon, 31 Mar 2025 21:06:18 -0700
parents 948ddc60813e
children
files Makefile
diffstat 1 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Mon Mar 31 21:05:42 2025 -0700
+++ b/Makefile	Mon Mar 31 21:06:18 2025 -0700
@@ -1,5 +1,6 @@
 #disable built-in rules
 .SUFFIXES :
+.PHONY: all clean
 
 ifndef OS
 OS:=$(shell uname -s)
@@ -328,6 +329,19 @@
 
 LIBCFLAGS=$(CFLAGS) -fpic -DIS_LIB -DDISABLE_ZLIB
 
+all : $(ALL)
+
+ORDERONLY:=$(OBJDIR)
+LIBORDERONLY:=$(LIBOBJDIR)
+ifdef NEW_CORE
+ifeq ($(wildcard $(OBJDIR)/*.d),)
+ORDERONLY+= m68k.c z80.c
+endif
+ifeq ($(wildcard $(LIBOBJDIR)/*.d),)
+LIBORDERONLY+= m68k.c z80.c
+endif
+endif
+
 -include $(MAINOBJS:%.o=$(OBJDIR)/%.d)
 -include $(LIBOBJS:%.o=$(LIBOBJDIR)/%.d)
 -include $(DISOBJS:.o=$(OBJDIR)/%.d)
@@ -335,8 +349,6 @@
 -include $(OBJDIR)/ztestrun.d
 -include $(OBJDIR)/blastcpm.d
 
-all : $(ALL)
-
 $(OBJDIR) :
 	mkdir -p $(OBJDIR)/nuklear_ui
 	mkdir -p $(OBJDIR)/zlib
@@ -385,22 +397,22 @@
 %.db.c : %.db
 	sed $< -e 's/"/\\"/g' -e 's/^\(.*\)$$/"\1\\n"/' -e'1s/^\(.*\)$$/const char $(shell echo $< | tr '.' '_')_data[] = \1/' -e '$$s/^\(.*\)$$/\1;/' > $@
 
-$(OBJDIR)/%.o : %.S | $(OBJDIR)
+$(OBJDIR)/%.o : %.S | $(ORDERONLY)
 	$(CC) -c -MMD -o $@ $<
 
-$(OBJDIR)/%.o : %.c | $(OBJDIR)
+$(OBJDIR)/%.o : %.c | $(ORDERONLY)
 	$(CC) $(CFLAGS) -c -MMD -o $@ $<
 
-$(OBJDIR)/%.o : %.m | $(OBJDIR)
+$(OBJDIR)/%.o : %.m | $(ORDERONLY)
 	$(CC) $(CFLAGS) -c -MMD -o $@ $<
 
-$(LIBOBJDIR)/%.o : %.S | $(LIBOBJDIR)
+$(LIBOBJDIR)/%.o : %.S | $(LIBORDERONLY)
 	$(CC) -c -MMD -o $@ $<
 
-$(LIBOBJDIR)/%.o : %.c | $(LIBOBJDIR)
+$(LIBOBJDIR)/%.o : %.c | $(LIBORDERONLY)
 	$(CC) $(LIBCFLAGS) -c -MMD -o $@ $<
 
-$(LIBOBJDIR)/%.o : %.m | $(LIBOBJDIR)
+$(LIBOBJDIR)/%.o : %.m | $(LIBORDERONLY)
 	$(CC) $(LIBCFLAGS) -c -MMD -o $@ $<
 
 %.png : %.xcf