git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Usermode/Build - Updates to build system for crtbegin/crtend
[tpg/acess2.git]
/
Usermode
/
Applications
/
Makefile.tpl
diff --git
a/Usermode/Applications/Makefile.tpl
b/Usermode/Applications/Makefile.tpl
index
adbc80a
..
27cf9e5
100644
(file)
--- a/
Usermode/Applications/Makefile.tpl
+++ b/
Usermode/Applications/Makefile.tpl
@@
-4,35
+4,54
@@
#
CFLAGS += -Wall -Werror -fno-builtin -fno-stack-protector -g
#
CFLAGS += -Wall -Werror -fno-builtin -fno-stack-protector -g
-LDFLAGS +=
-
-DEPFILES := $(OBJ:%.o=%.d)
+LDFLAGS += -g
_BIN := $(OUTPUTDIR)$(DIR)/$(BIN)
_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)
.PHONY : all clean install
all: $(_BIN)
clean:
.PHONY : all clean install
all: $(_BIN)
clean:
- @$(RM) $(OBJ) $(DEPFILES) $(_BIN) $(BIN).dsm Map.txt
+ @$(RM) $(OBJ) $(DEPFILES) $(_BIN) $(BIN).dsm
+ @$(RM) -r $(_OBJPREFIX)
-install: $(BIN)
- $(xCP) $(_BIN) $(DISTROOT)/$(DIR)/
+install: $(_BIN)
+ @echo [xCP] $(DISTROOT)/$(DIR)/$(BIN)
+ @$(xMKDIR) $(DISTROOT)/$(DIR); true
+ @$(STRIP) $(_BIN) -o $(_BIN)_
+ @$(xCP) $(_BIN)_ $(DISTROOT)/$(DIR)/$(BIN)
+ @$(RM) $(_BIN)_
-$(_BIN): $(OBJ)
+$(_BIN): $(O
UTPUTDIR)Libs/acess.ld $(OUTPUTDIR)Libs/crt0.o $(_LIBS) $(O
BJ)
@mkdir -p $(dir $(_BIN))
@mkdir -p $(dir $(_BIN))
- @echo
--- $(LD)
-o $@
+ @echo
[LD]
-o $@
ifneq ($(_DBGMAKEFILE),)
ifneq ($(_DBGMAKEFILE),)
- $(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map Map.txt
+ $(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map
$(_OBJPREFIX)
Map.txt
else
else
- @$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map Map.txt
+ @$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map
$(_OBJPREFIX)
Map.txt
endif
endif
- @
objdump -d -S $(_BIN) >
$(BIN).dsm
+ @
$(DISASM) $(_BIN) > $(_OBJPREFIX)
$(BIN).dsm
-$(OBJ): %.o: %.c
- @echo --- GCC -o $@
+$(OBJ): $(_OBJPREFIX)%.o: %.c
+ @echo [CC] -o $@
+ifneq ($(_OBJPREFIX),)
+ @mkdir -p $(dir $@)
+endif
@$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
@$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- @$(CC) -M -MT $@ $(CPPFLAGS) $< -o $*.d
+ @$(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)
-include $(DEPFILES)
UCC
git Repository :: git.ucc.asn.au