summaryrefslogtreecommitdiffstatshomepage
path: root/makefile
diff options
context:
space:
mode:
authorGravatarGravatar Aaron Giles <aaron@aarongiles.com>2010-09-14 01:15:26 +0000
committerGravatarGravatar Aaron Giles <aaron@aarongiles.com>2010-09-14 01:15:26 +0000
commitdb797ba7913c0edfbc8a7d9fae4b1065d61a1ad2 (patch)
treef5c8c3043ab4acebdc2e45da7dc826990f9542b7 /makefile
parent7d09104932a3e0e8cd9eb20e8296c26a907f0c6b (diff)
New build tool makedep.c, derived from src2html.c (really!).
Does basic dependency analysis and supports excluding paths. Makefile now supports a depend target which will run makedep on the src/$(TARGET) tree and create dependencies. It deliberately excludes the root of src/emu as well as the osd directories in order to keep the dependency file down to a reasonable size, so if a core header file changes, you still need to clean and build all.
Diffstat (limited to 'makefile')
-rw-r--r--makefile35
1 files changed, 30 insertions, 5 deletions
diff --git a/makefile b/makefile
index 08b5823fd74..dbcd332cf42 100644
--- a/makefile
+++ b/makefile
@@ -489,7 +489,7 @@ COBJFLAGS += \
#-------------------------------------------------
# add core include paths
-CCOMFLAGS += \
+INCPATH += \
-I$(SRC)/$(TARGET) \
-I$(OBJ)/$(TARGET)/layout \
-I$(SRC)/emu \
@@ -500,6 +500,7 @@ CCOMFLAGS += \
-I$(SRC)/osd/$(OSD) \
+
#-------------------------------------------------
# archiving flags
#-------------------------------------------------
@@ -585,7 +586,7 @@ LIBS =
# add expat XML library
ifeq ($(BUILD_EXPAT),1)
-CCOMFLAGS += -I$(SRC)/lib/expat
+INCPATH += -I$(SRC)/lib/expat
EXPAT = $(OBJ)/libexpat.a
else
LIBS += -lexpat
@@ -594,7 +595,7 @@ endif
# add ZLIB compression library
ifeq ($(BUILD_ZLIB),1)
-CCOMFLAGS += -I$(SRC)/lib/zlib
+INCPATH += -I$(SRC)/lib/zlib
ZLIB = $(OBJ)/libz.a
else
LIBS += -lz
@@ -643,6 +644,7 @@ include $(SRC)/build/build.mak
include $(SRC)/tools/tools.mak
# combine the various definitions to one
+CCOMFLAGS += $(INCPATH)
CDEFS = $(DEFS)
@@ -655,6 +657,22 @@ emulator: maketree $(BUILD) $(EMULATOR)
buildtools: maketree $(BUILD)
+# In order to keep dependencies reasonable, we exclude objects in the base of
+# $(SRC)/emu, as well as all the OSD objects and anything in the $(OBJ) tree
+depend: maketree $(MAKEDEP_TARGET)
+ @echo Rebuilding depend.mak...
+ $(MAKEDEP) -I. $(INCPATH) -X$(SRC)/emu -X$(SRC)/osd/... -X$(OBJ)/... src/mame > depend.mak
+
+INCPATH += \
+ -I$(SRC)/$(TARGET) \
+ -I$(OBJ)/$(TARGET)/layout \
+ -I$(SRC)/emu \
+ -I$(OBJ)/emu \
+ -I$(OBJ)/emu/layout \
+ -I$(SRC)/lib/util \
+ -I$(SRC)/osd \
+ -I$(SRC)/osd/$(OSD) \
+
tools: maketree $(TOOLS)
maketree: $(sort $(OBJDIRS))
@@ -725,11 +743,11 @@ $(OBJ)/%.s: $(SRC)/%.c | $(OSPREBUILD)
@echo Compiling $<...
$(CC) $(CDEFS) $(CFLAGS) -S $< -o $@
-$(OBJ)/%.lh: $(SRC)/%.lay $(FILE2STR)
+$(OBJ)/%.lh: $(SRC)/%.lay $(FILE2STR_TARGET)
@echo Converting $<...
@$(FILE2STR) $< $@ layout_$(basename $(notdir $<))
-$(OBJ)/%.fh: $(SRC)/%.png $(PNG2BDC) $(FILE2STR)
+$(OBJ)/%.fh: $(SRC)/%.png $(PNG2BDC_TARGET) $(FILE2STR_TARGET)
@echo Converting $<...
@$(PNG2BDC) $< $(OBJ)/temp.bdc
@$(FILE2STR) $(OBJ)/temp.bdc $@ font_$(basename $(notdir $<)) UINT8
@@ -745,3 +763,10 @@ $(OBJ)/%.o: $(SRC)/%.m | $(OSPREBUILD)
$(CC) $(CDEFS) $(COBJFLAGS) $(CCOMFLAGS) -c $< -o $@
endif
+
+
+#-------------------------------------------------
+# optional dependencies file
+#-------------------------------------------------
+
+-include depend.mak