X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device%2Flib%2Fmcs51%2FMakefile.in;h=c6e460a6e62c1e52a36002b238afb705d396c4b6;hb=8c7fbbcddc62866b37a6643a94544aa0b03638eb;hp=7fc63975812417bafe41baa454e0b627ff432b60;hpb=d97374011f31b3e37d7f77c43d04d536f4528991;p=fw%2Fsdcc diff --git a/device/lib/mcs51/Makefile.in b/device/lib/mcs51/Makefile.in index 7fc63975..c6e460a6 100644 --- a/device/lib/mcs51/Makefile.in +++ b/device/lib/mcs51/Makefile.in @@ -4,11 +4,15 @@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = @top_builddir@ -SAS = $(top_builddir)bin/asx8051 -SCC = $(top_builddir)bin/sdcc +LIB_TYPE = @LIB_TYPE@ +SAS = $(top_builddir)/bin/asx8051 +SCC = $(top_builddir)/bin/sdcc + +# override PORTDIR defined by super (parent) makefile +override PORTDIR = ../build/$(PORT) OBJ = crtstart.rel crtxinit.rel crtxclear.rel crtclear.rel crtxstack.rel \ - crtpagesfr.rel crtbank.rel + crtpagesfr.rel crtbank.rel crtcall.rel LIB = mcs51.lib @@ -16,13 +20,24 @@ CC = $(SCC) AS = $(SAS) ASFLAGS = -plosgff -CFLAGS = -I$(top_srcdir)/include - -all: $(LIB) - -$(LIB): $(OBJ) Makefile - rm -f $(LIB) - for i in $(OBJ); do echo $$i >> $(LIB); done +CFLAGS = -I$(top_srcdir)/include --std-c89 + +all: $(PORTDIR)/$(LIB) + +$(PORTDIR)/$(LIB): $(OBJ) Makefile +ifeq ($(LIB_TYPE), SDCCLIB) + rm -f $@; \ + ../../../bin/sdcclib -a $@ $(OBJ) +else ifeq ($(LIB_TYPE), AR) + ar -Scq $@ $(OBJ) +else ifeq ($(LIB_TYPE), RANLIB) + ar -Scq $@ $(OBJ) + $(top_builddir)/bin/asranlib $@ +else + rm -f $@ + for i in $(basename $(OBJ)); do echo $$i >>$@; done + cp $(OBJ) $(PORTDIR) +endif %.rel: %.c $(CC) $(CFLAGS) -c $< @@ -37,4 +52,4 @@ clean: rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.lib distclean: clean - rm -r Makefile \ No newline at end of file + rm -r Makefile