SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
-STATIC_OBJS := $(OBJS) $(STATIC_OBJS)
-SHARED_OBJS := $(OBJS) $(SHARED_OBJS)
all: $(LIBNAME) $(SLIBNAME)
-$(LIBNAME): $(STATIC_OBJS)
+$(LIBNAME): $(OBJS)
rm -f $@
$(AR) rc $@ $^ $(EXTRAOBJS)
$(RANLIB) $@
$(SLIBNAME): $(SLIBNAME_WITH_MAJOR)
$(LN_S) $^ $@
-$(SLIBNAME_WITH_MAJOR): $(SHARED_OBJS)
+$(SLIBNAME_WITH_MAJOR): $(OBJS)
+ $(SLIB_CREATE_DEF_CMD)
$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
$(SLIB_EXTRA_CMD)
clean::
rm -f *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
- *.def *.dll.a *.exp *.ho
+ *.def *.dll.a *.exp *.ho *.map $(TESTS)
distclean: clean
rm -f .depend
rm -f $(addprefix "$(INCDIR)/",$(HEADERS))
rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
-.PHONY: all depend dep clean distclean install* uninstall*
+tests: $(TESTS)
+
+%-test$(EXESUF): %.c $(LIBNAME)
+ $(CC) $(CFLAGS) $(LDFLAGS) -DTEST -o $@ $^ $(EXTRALIBS)
+
+.PHONY: all depend dep clean distclean install* uninstall* tests
-include .depend