X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2FMakefile.tpl;h=a6c8508c4ce379df754d7e9569deb4b04ca230e8;hb=e6b7fab5aac546bcd2be3c37ea14a3ab46cf92d5;hp=f42e66016156b2978b456f9d5fa7a3299de3efe2;hpb=bfb42102be5c178ce08b7861c11ee2694004413a;p=tpg%2Facess2.git diff --git a/Usermode/Applications/Makefile.tpl b/Usermode/Applications/Makefile.tpl index f42e6601..a6c8508c 100644 --- a/Usermode/Applications/Makefile.tpl +++ b/Usermode/Applications/Makefile.tpl @@ -6,6 +6,14 @@ CFLAGS += -g LDFLAGS += -g +LDFLAGS += -Map $(_OBJPREFIX)Map.txt + +ifneq ($(lastword $(subst -, ,$(basename $(LD)))),ld) + comma=, + LDFLAGS := $(subst -rpath-link ,-Wl$(comma)-rpath-link$(comma),$(LDFLAGS)) + LDFLAGS := $(subst -Map ,-Wl$(comma)-Map$(comma),$(LDFLAGS)) +endif + _BIN := $(OUTPUTDIR)$(DIR)/$(BIN) _OBJPREFIX := obj-$(ARCH)/ @@ -40,15 +48,10 @@ install: $(_BIN) $(_BIN): $(OUTPUTDIR)Libs/acess.ld $(OUTPUTDIR)Libs/crt0.o $(_LIBS) $(OBJ) @mkdir -p $(dir $(_BIN)) @echo [LD] -o $@ -#ifeq ($(ARCHDIR),native) -# $V$(LD) -g -o $@.tmp.o -r $(OBJ) $(LIBGCC_PATH) -# $V$(LD) -g $(LDFLAGS) -o $@ $@.tmp.o -Map $(_OBJPREFIX)Map.txt -#else - $V$(LD) -g $(LDFLAGS) -o $@ $(OBJ) -Map $(_OBJPREFIX)Map.txt $(LIBGCC_PATH) -#endif + $V$(LD) -g $(LDFLAGS) -o $@ $(CRTBEGIN) $(OBJ) $(LIBGCC_PATH) $(CRTEND) $V$(DISASM) $(_BIN) > $(_OBJPREFIX)$(BIN).dsm -$(OBJ): $(_OBJPREFIX)%.o: %.c +$(_OBJPREFIX)%.o: %.c @echo [CC] -o $@ ifneq ($(_OBJPREFIX),) @mkdir -p $(dir $@) @@ -56,6 +59,13 @@ endif $V$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ $V$(CC) -M -MP -MT $@ $(CPPFLAGS) $< -o $(_OBJPREFIX)$*.dep +$(_OBJPREFIX)%.o: %.cpp + @echo [CXX] -o $@ +ifneq ($(_OBJPREFIX),) + @mkdir -p $(dir $@) +endif + $V$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ -MQ $@ -MP -MD -MF $(_OBJPREFIX)$*.dep + $(OUTPUTDIR)Libs/libld-acess.so: @make -C $(ACESSDIR)/Usermode/Libraries/ld-acess.so_src/ $(OUTPUTDIR)Libs/%: