X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FLibraries%2FMakefile.tpl;h=7c9546f5f4153bf872b6b32964b6242e5f6a8f0d;hb=bdd7f1f599b357218e219aeb2bd9264e6412d629;hp=774952172e44502884a962c36ccd5bd865beeea9;hpb=bfb42102be5c178ce08b7861c11ee2694004413a;p=tpg%2Facess2.git diff --git a/Usermode/Libraries/Makefile.tpl b/Usermode/Libraries/Makefile.tpl index 77495217..7c9546f5 100644 --- a/Usermode/Libraries/Makefile.tpl +++ b/Usermode/Libraries/Makefile.tpl @@ -2,6 +2,21 @@ # - Library Common Makefile # +comma=, + +LDFLAGS += -soname $(BIN) + +ifeq ($(ARCH),native) + LDFLAGS := $(LDFLAGS:-lc=-lc_acess) +endif + +_LD_CMD := $(lastword $(subst -, ,$(firstword $(LD)))) +ifneq ($(_LD_CMD),ld) + LDFLAGS := $(subst -soname ,-Wl$(comma)-soname$(comma),$(LDFLAGS)) + LDFLAGS := $(subst -Map ,-Wl$(comma)-Map$(comma),$(LDFLAGS)) + LDFLAGS := $(LDFLAGS:-x=-Wl,-x) + LDFLAGS := $(LDFLAGS:--%=-Wl,--%) +endif _BIN := $(addprefix $(OUTPUTDIR)Libs/,$(BIN)) _XBIN := $(addprefix $(OUTPUTDIR)Libs/,$(EXTRABIN)) @@ -66,7 +81,7 @@ endif # for f in $(INCFILES); do ln -s $f $(ACESSDIR)/include/$f; done #endif -$(_BIN): $(OBJ) $(_LIBS) +$(_BIN): $(OBJ) @mkdir -p $(dir $(_BIN)) @echo [LD] -o $(BIN) $(OBJ) $V$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name)