From: John Hodge Date: Tue, 27 Sep 2011 01:28:26 +0000 (+0800) Subject: Modules - Moved to using object directories X-Git-Tag: rel0.11~47 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=2622ded2495e40b728cf0f16e46d80596dcc6d02;p=tpg%2Facess2.git Modules - Moved to using object directories --- diff --git a/Modules/Makefile.tpl b/Modules/Makefile.tpl index de3b36ab..dda0f6b9 100644 --- a/Modules/Makefile.tpl +++ b/Modules/Makefile.tpl @@ -27,10 +27,11 @@ else BIN := ../$(NAME).xo.$(ARCH) endif -OBJ := $(addsuffix .$(_SUFFIX),$(OBJ)) +OBJ := $(addprefix obj-$(_SUFFIX)/,$(OBJ)) +#OBJ := $(addsuffix .$(_SUFFIX),$(OBJ)) -DEPFILES := $(filter %.o.$(_SUFFIX),$(OBJ)) -DEPFILES := $(DEPFILES:%.o.$(_SUFFIX)=%.d.$(ARCH)) +DEPFILES := $(filter %.o,$(OBJ)) +DEPFILES := $(DEPFILES:%.o=%.d) .PHONY: all clean @@ -38,6 +39,7 @@ all: $(BIN) clean: $(RM) $(BIN) $(BIN).dsm $(KOBJ) $(OBJ) $(DEPFILES) $(EXTRA) + $(RM) -r obj-$(_SUFFIX) install: $(BIN) ifneq ($(BUILDTYPE),static) @@ -46,10 +48,10 @@ ifneq ($(BUILDTYPE),static) else endif + ifneq ($(BUILDTYPE),static) $(BIN): %.kmd.$(ARCH): $(OBJ) @echo --- $(LD) -o $@ -# @$(LD) -T $(ACESSDIR)/Modules/link.ld --allow-shlib-undefined -shared -nostdlib -o $@ $(OBJ) @$(LD) --allow-shlib-undefined -shared -nostdlib -o $@ $(OBJ) -defsym=DriverInfo=_DriverInfo_$(FULLNAME) @$(DISASM) $(BIN) > $(BIN).dsm else @@ -58,9 +60,10 @@ $(BIN): %.xo.$(ARCH): $(OBJ) @$(LD) -r -o $@ $(OBJ) endif -%.o.$(_SUFFIX): %.c Makefile $(CFGFILES) +obj-$(_SUFFIX)/%.o: %.c Makefile $(CFGFILES) @echo --- $(CC) -o $@ + @mkdir -p $(dir $@) @$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $< - @$(CC) -M $(CPPFLAGS) -MT $@ -o $*.d.$(ARCH) $< + @$(CC) -M $(CPPFLAGS) -MT $@ -o obj-$(_SUFFIX)/$*.d $< -include $(DEPFILES) diff --git a/Modules/x86/Makefile b/Modules/x86/Makefile deleted file mode 100644 index 60999df0..00000000 --- a/Modules/x86/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - - -.PHONY: all clean install all-install - -all clean install all-install %: - @make -C ISADMA/ $@