* Makefile.in, configure.in, configure,
[fw/sdcc] / device / lib / hc08 / Makefile.in
index 844b120ee7264a72687ccc1b866194ebb97b19a8..7b8e7a079dfe35ace196cf381bb7f48ecb4bfb6b 100644 (file)
@@ -2,12 +2,17 @@
 
 VPATH  = @srcdir@
 srcdir = @srcdir@
+top_builddir = @top_builddir@
+
+LIB_TYPE     = @LIB_TYPE@
 
 TOPDIR = ../../..
 
 SCC = $(TOPDIR)/bin/sdcc -mhc08
 SAS = $(TOPDIR)/bin/as6808
 
+PORTDIR = ../build/hc08
+
 OBJ = _ret.rel _divuint.rel _divulong.rel _mulint.rel _mullong.rel
 
 LIB = hc08.lib
@@ -15,13 +20,24 @@ CC = $(SCC)
 AS = $(SAS)
 ASFLAGS = -plosgff
 
-CFLAGS = -I../../include -I.
-
-all: $(LIB)
-
-$(LIB): $(OBJ) Makefile _dummy
-       rm -f $(LIB)
-       for i in $(OBJ); do echo $$i >> $(LIB); done
+CFLAGS = -I$(srcdir)/../../include -I. --std-c99
+
+all: $(PORTDIR)/$(LIB)
+
+$(PORTDIR)/$(LIB): $(OBJ) Makefile _dummy
+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 $<
@@ -35,4 +51,4 @@ clean:
        rm -f *.rel *.sym *.lst *~ $(CLEANSPEC) *.dump* *.asm *.lib
 
 distclean: clean
-       rm -f Makefile
\ No newline at end of file
+       rm -f Makefile