- Now all object files are put in a directory for each architecture
> e.g. 'obj-i386/main.o'
- Fixed a compile error in telnet
CFLAGS += -Wall -Werror -fno-builtin -fno-stack-protector -g
LDFLAGS +=
CFLAGS += -Wall -Werror -fno-builtin -fno-stack-protector -g
LDFLAGS +=
-DEPFILES := $(OBJ:%.o=%.d)
-
_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
+_OBJPREFIX := obj-$(ARCH)/
+
+OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
+
+DEPFILES := $(OBJ:%.o=%.dep)
.PHONY : all clean install
.PHONY : all clean install
endif
@objdump -d -S $(_BIN) > $(BIN).dsm
endif
@objdump -d -S $(_BIN) > $(BIN).dsm
+$(OBJ): $(_OBJPREFIX)%.o: %.c
+ifneq ($(_OBJPREFIX),)
+ @mkdir -p $(_OBJPREFIX)
+endif
@$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
@$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- @$(CC) -M -MT $@ $(CPPFLAGS) $< -o $*.d
+ @$(CC) -M -MT $@ $(CPPFLAGS) $< -o $(_OBJPREFIX)$*.dep
int OpenTCP(const char *AddressString, short PortNumber)\r
{\r
int fd, addrType;\r
int OpenTCP(const char *AddressString, short PortNumber)\r
{\r
int fd, addrType;\r
uint8_t addrBuffer[16];\r
\r
// Parse IP Address\r
uint8_t addrBuffer[16];\r
\r
// Parse IP Address\r
-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/
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
#
# - Library Common Makefile
#
-DEPFILES := $(addsuffix .d,$(OBJ))
_BIN := $(OUTPUTDIR)Libs/$(BIN)
_XBIN := $(addprefix $(OUTPUTDIR)Libs/,$(EXTRABIN))
_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
.PHONY: all clean install postbuild
@$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ)
@$(OBJDUMP) -d -S $(_BIN) > $(_BIN).dsm
@$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ)
@$(OBJDUMP) -d -S $(_BIN) > $(_BIN).dsm
@$(CC) $(CFLAGS) -o $@ -c $<
@$(CC) $(CFLAGS) -o $@ -c $<
+$(_OBJPREFIX)%.ao: %.asm
@$(AS) $(ASFLAGS) -o $@ $<
@$(AS) $(ASFLAGS) -o $@ $<