_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
_OBJPREFIX := obj-$(ARCH)/
+_LIBS := $(filter -l%,$(LDFLAGS))
+_LIBS := $(patsubst -l%,$(OUTPUTDIR)Libs/lib%.so,$(_LIBS))
+
OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
DEPFILES := $(OBJ:%.o=%.dep)
all: $(_BIN)
clean:
- @$(RM) $(OBJ) $(DEPFILES) $(_BIN) $(BIN).dsm Map.txt
+ @$(RM) $(OBJ) $(DEPFILES) $(_BIN) $(BIN).dsm
+ @$(RM) -r $(_OBJPREFIX)
install: $(_BIN)
@echo [xCP] $(DISTROOT)/$(DIR)/$(BIN)
@$(xCP) $(_BIN)_ $(DISTROOT)/$(DIR)/$(BIN)
@$(RM) $(_BIN)_
-$(_BIN): $(OBJ)
+$(_BIN): $(OUTPUTDIR)Libs/acess.ld $(OUTPUTDIR)Libs/crt0.o $(_LIBS) $(OBJ)
@mkdir -p $(dir $(_BIN))
@echo [LD] -o $@
ifneq ($(_DBGMAKEFILE),)
- $(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map Map.txt
+ $(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map $(_OBJPREFIX)Map.txt
else
- @$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map Map.txt
+ @$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map $(_OBJPREFIX)Map.txt
endif
@$(DISASM) $(_BIN) > $(BIN).dsm
@$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
@$(CC) -M -MT $@ $(CPPFLAGS) $< -o $(_OBJPREFIX)$*.dep
+$(OUTPUTDIR)Libs/libld-acess.so:
+ @make -C $(ACESSDIR)/Usermode/Libraries/ld-acess.so_src/
+$(OUTPUTDIR)Libs/%:
+ @make -C $(ACESSDIR)/Usermode/Libraries/$*_src/
+
-include $(DEPFILES)
_XBIN := $(addprefix $(OUTPUTDIR)Libs/,$(EXTRABIN))
_OBJPREFIX := obj-$(ARCH)/
+_LIBS := $(filter -l%,$(LDFLAGS))
+_LIBS := $(patsubst -l%,$(OUTPUTDIR)Libs/lib%.so,$(_LIBS))
+
OBJ := $(addprefix $(_OBJPREFIX),$(OBJ))
DEPFILES := $(addsuffix .dep,$(OBJ))
@$(AS) $(ASFLAGS) -o $@ $<
+#$(OUTPUTDIR)Libs/libld-acess.so:
+# @make -C $(ACESSDIR)/Usermode/Libraries/ld-acess.so_src/
+$(OUTPUTDIR)Libs/%:
+ @make -C $(ACESSDIR)/Usermode/Libraries/$*_src/
+
-include $(DEPFILES)