$NetBSD: patch-aa,v 1.3 2004/11/27 12:12:16 gson Exp $ --- Makefile.orig Tue Oct 29 16:28:26 2002 +++ Makefile @@ -181,6 +181,13 @@ OTHER_FLAGS = -Wall endif +ifeq ($(OS), NETBSD) +OTHER_FLAGS = -Wall +TARGETDIR = . +# The following is a lie; we do build dynamic libraries +STATIC_ONLY = yes +endif + ifeq ($(OS), OPENBSD) SFLAGS = -fPIC LDFLAGS = -shared -soname=$(SONAME) -lc @@ -236,14 +243,14 @@ CFLAGS += $(DEFINES) $(OTHER_FLAGS) -OBJS = $(TARGETDIR)/sched.o \ - $(TARGETDIR)/stk.o \ - $(TARGETDIR)/sync.o \ - $(TARGETDIR)/key.o \ - $(TARGETDIR)/io.o +OBJS = $(TARGETDIR)/sched.lo \ + $(TARGETDIR)/stk.lo \ + $(TARGETDIR)/sync.lo \ + $(TARGETDIR)/key.lo \ + $(TARGETDIR)/io.lo OBJS += $(EXTRA_OBJS) HEADER = $(TARGETDIR)/st.h -SLIBRARY = $(TARGETDIR)/libst.a +SLIBRARY = $(TARGETDIR)/libst.la DLIBRARY = $(TARGETDIR)/libst.$(DSO_SUFFIX).$(VERSION) EXAMPLES = examples @@ -294,8 +301,7 @@ if [ ! -d $(TARGETDIR) ]; then mkdir $(TARGETDIR); fi $(SLIBRARY): $(OBJS) - $(AR) $(ARFLAGS) $@ $(OBJS) - $(RANLIB) $@ + ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS} -rpath ${PREFIX}/lib -version-info 1:4 rm -f obj; $(LN) $(LNFLAGS) $(TARGETDIR) obj $(DLIBRARY): $(OBJS:%.o=%-pic.o) @@ -311,11 +317,11 @@ rm -f $@ cp public.h $@ -$(TARGETDIR)/%asm.o: %asm.S - $(CC) $(CFLAGS) -c $< -o $@ +$(TARGETDIR)/%asm.lo: %asm.S + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@ -$(TARGETDIR)/%.o: %.c common.h md.h - $(CC) $(CFLAGS) -c $< -o $@ +$(TARGETDIR)/%.lo: %.c common.h md.h + $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $< -o $@ examples:: @cd $@; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" OS="$(OS)" TARGETDIR="$(TARGETDIR)"