pkgsrc/devel/libf2c/files/ltlib.mk
asau 0bb17a7d0e Import libf2c-20090201 as devel/libf2c.
libf2c is Fortran support library distributed by Netlib with f2c
(Fortran 77 to C translator).
libf2c combines libF77 and libI77 in one library.
2009-12-02 22:32:46 +00:00

34 lines
868 B
Makefile

# building library using libtool, simplified
.include "bsd.init.mk"
.include <bsd.obj.mk>
.include <bsd.dep.mk>
.-include <bsd.depall.mk> # it doesn't exist on NetBSD
OBJS+= $(SRCS:.c=.o)
LTOBJS+= $(SRCS:.c=.lo)
.SUFFIXES: .c .lo
.c.lo:
$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
lib$(LIB).la: $(LTOBJS)
$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(LTOBJS) $(LDFLAGS) -rpath $(LIBDIR) -version-info $(SHLIB_MAJOR):$(SHLIB_MINOR)
$(LTOBJS): $(DPSRCS)
all: lib$(LIB).la
install: lib$(LIB).la
$(LIBTOOL) --mode=install $(INSTALL) $(RENAME) $(PRESERVE) $(COPY) $(INSTPRIV) \
-o $(LIBOWN) -g $(LIBGRP) -m $(LIBMODE) \
lib$(LIB).la $(DESTDIR)$(LIBDIR)
clean cleandir:
rm -f $(CLEANFILES)
rm -f lib$(LIB).la $(LTOBJS) $(OBJS)
rm -rf .libs
LIBTOOL?= libtool
LIBDIR?= /usr/local/lib # required
.include "bsd.inc.mk"