CFLAGS += -Wall -Werror -fno-builtin -fno-stack-protector -g
LDFLAGS +=
-DEPFILES := $(OBJ:%.o=%.d)
-
_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
+_OBJPREFIX := obj-$(ARCH)/
+
+OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
+
+DEPFILES := $(OBJ:%.o=%.dep)
.PHONY : all clean install
endif
@objdump -d -S $(_BIN) > $(BIN).dsm
-$(OBJ): %.o: %.c
+$(OBJ): $(_OBJPREFIX)%.o: %.c
@echo --- GCC -o $@
+ifneq ($(_OBJPREFIX),)
+ @mkdir -p $(_OBJPREFIX)
+endif
@$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- @$(CC) -M -MT $@ $(CPPFLAGS) $< -o $*.d
+ @$(CC) -M -MT $@ $(CPPFLAGS) $< -o $(_OBJPREFIX)$*.dep
-include $(DEPFILES)
int OpenTCP(const char *AddressString, short PortNumber)\r
{\r
int fd, addrType;\r
- char *iface;\r
uint8_t addrBuffer[16];\r
\r
// Parse IP Address\r
MAKEDEP = $(CC) -M
-ASFLAGS := -felf
-CPPFLAGS := -I$(ACESSDIR)/Usermode/include/
+ASFLAGS := -felf -D ARCHDIR=$(ARCHDIR)
+CPPFLAGS := -I$(ACESSDIR)/Usermode/include/ -D ARCHDIR=$(ARCHDIR) -D ARCHDIR_IS_$(ARCHDIR)=1
CFLAGS := -g -Wall -fPIC -fno-builtin -fno-stack-protector $(CPPFLAGS)
LDFLAGS := -g -nostdlib -shared -I/Acess/Libs/ld-acess.so -e SoMain -x -L$(OUTPUTDIR)Libs/
# - Library Common Makefile
#
-DEPFILES := $(addsuffix .d,$(OBJ))
_BIN := $(OUTPUTDIR)Libs/$(BIN)
_XBIN := $(addprefix $(OUTPUTDIR)Libs/,$(EXTRABIN))
+_OBJPREFIX := obj-$(ARCH)/
+
+OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
+
+DEPFILES := $(addsuffix .dep,$(OBJ))
.PHONY: all clean install postbuild
@$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ)
@$(OBJDUMP) -d -S $(_BIN) > $(_BIN).dsm
-%.o: %.c
+$(_OBJPREFIX)%.o: %.c
@echo [CC] -o $@
+ @mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -o $@ -c $<
-%.ao: %.asm
+$(_OBJPREFIX)%.ao: %.asm
@echo [AS] -o $@
+ @mkdir -p $(dir $@)
@$(AS) $(ASFLAGS) -o $@ $<
-include $(DEPFILES)