3
0
mirror of https://github.com/XboxDev/nxdk.git synced 2026-02-04 15:05:30 +00:00

Add better source dependency tracking.

This commit is contained in:
Matt Borgerson
2016-01-02 20:01:16 -07:00
parent 22085a7ec3
commit 3155355fda
5 changed files with 16 additions and 17 deletions

2
.gitignore vendored
View File

@ -5,6 +5,6 @@
*.o
*.xbe
*.inl
*.d
_*.cpp
_*.h

View File

@ -52,6 +52,8 @@ else
STDOUT_TO_NULL=>/dev/null
endif
DEPS := $(SRCS:.c=.d)
all: $(TARGET)
$(OUTPUT_DIR)/default.xbe: $(OUTPUT_DIR) main.exe
@ -76,10 +78,15 @@ ifeq ($(UNAME_S),Darwin)
$(VE) $(LD) -subsystem:windows -dll -out:'$@' -entry:XboxCRT $^
endif
%.obj: %.c $(INCLUDES)
%.obj: %.c
@echo "[ CC ] $@"
$(VE) $(CC) $(CFLAGS) -c -o '$@' '$<'
%.d: %.c
@echo "[ DEP ] $@"
$(VE) set -e; rm -f $@; \
$(CC) -M -MG -MT '$*.obj $@' -MF $@ $(CFLAGS) $<
%.inl: %.vs.cg
@echo "[ CG ] $@"
$(VE) $(CGC) -profile vp20 -o $@.$$$$ $< ; \
@ -115,7 +122,7 @@ extract-xiso:
clean:
$(VE)rm -f $(TARGET) \
main.exe main.exe.manifest \
$(OBJS) $(SHADEROBJ) \
$(OBJS) $(SHADER_OBJS) \
$(GEN_XISO)
.PHONY: distclean
@ -125,3 +132,6 @@ distclean: clean
$(VE)$(MAKE) -C $(NXDK_DIR)/tools/vp20compiler distclean $(STDOUT_TO_NULL)
$(VE)$(MAKE) -C $(NXDK_DIR)/tools/cxbe clean $(STDOUT_TO_NULL)
$(VE)bash -c "if [ -d $(OUTPUT_DIR) ]; then rmdir $(OUTPUT_DIR); fi"
$(VE)rm -f $(DEPS)
-include $(DEPS)

View File

@ -19,12 +19,6 @@ USB_SRCS := \
$(NXDK_DIR)/lib/usb/misc/pci.c \
$(NXDK_DIR)/lib/usb/misc/malloc.c
INCLUDES += \
$(wildcard $(NXDK_DIR)/lib/xboxkrnl/*.h) \
$(wildcard $(NXDK_DIR)/lib/xboxrt/*.h) \
$(wildcard $(NXDK_DIR)/lib/hal/*.h) \
$(wildcard $(NXDK_DIR)/lib/pbkit/*.h)
SRCS += \
$(wildcard $(NXDK_DIR)/lib/xboxrt/*.c) \
$(wildcard $(NXDK_DIR)/lib/hal/*.c) \

View File

@ -1,9 +1,5 @@
XBE_TITLE=0ldskoo1
SHADEROBJ = \
$(CURDIR)/vs.inl \
$(CURDIR)/ps.inl
INCLUDES = $(wildcard $(CURDIR)/*.h)
SRCS = $(wildcard $(CURDIR)/*.c)
SHADER_OBJS = ps.inl vs.inl
NXDK_DIR = $(CURDIR)/../..
include $(NXDK_DIR)/Makefile
$(CURDIR)/graphics.obj : $(SHADEROBJ)

View File

@ -1,5 +1,4 @@
XBE_TITLE=hello
INCLUDES += $(wildcard $(CURDIR)/*.h)
SRCS += $(wildcard $(CURDIR)/*.c)
SRCS = $(wildcard $(CURDIR)/*.c)
NXDK_DIR = $(CURDIR)/../..
include $(NXDK_DIR)/Makefile
include $(NXDK_DIR)/Makefile