LDFLAGS += -Wl,-init,SoMain
CFLAGS += -fPIC
endif
+else ifneq ($(HOST_ARCH),)
+ ASFLAGS += -D ARCHDIR=$(ARCHDIR) -D __ASSEMBLER__=1
+ #CPPFLAGS := -D SoMain="__attribute__ ((constructor(101))) libacessnative_init"
+ LD := $(CC)
+ ifeq ($(PLATFORM),windows)
+ else
+ LDFLAGS += -Wl,-init,SoMain
+ CFLAGS += -fPIC
+ endif
else
CPPFLAGS := -ffreestanding
CFLAGS := -fno-stack-protector -fPIC
LDFLAGS := $(LDFLAGS:-lc=-lc_acess)
endif
-ifneq ($(lastword $(subst -, ,$(basename $(LD)))),ld)
+_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)
# 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)