2 # Template makefile for building wxWindows companion libraries.
4 # Author: Ron Lee <ron@debian.org>
7 # To use, set the following vars before including it.
14 # either a shared or static lib will be built according to the
15 # option given to configure.
19 exec_prefix = @exec_prefix@
23 INSTALL_PROGRAM = @INSTALL_PROGRAM@
25 TARGETLIB_STATIC=$(TARGET_LIBNAME).a
26 TARGETLIB_SHARED=$(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT).$(LIBVERSION_REVISION).$(LIBVERSION_AGE)
27 TARGETLIB_LINK1=$(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT)
28 TARGETLIB_LINK2=$(TARGET_LIBNAME).so
30 # Clears all default suffixes
31 .SUFFIXES: .o .cpp .c .cxx
34 $(CCC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
37 $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $<
40 $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $<
42 include $(top_builddir)/src/make.env
45 all: libtype_@WX_TARGET_LIBRARY_TYPE@
47 libtype_so: CREATE_LINKS
49 libtype_a: $(TARGETLIB_STATIC)
52 $(TARGETLIB_SHARED): $(OBJECTS)
53 $(SHARED_LD) $@ $(OBJECTS)
55 CREATE_LINKS: $(TARGETLIB_SHARED)
56 @$(RM) $(TARGETLIB_LINK1) $(TARGETLIB_LINK2)
57 $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1)
58 $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
60 $(TARGETLIB_STATIC): $(OBJECTS)
61 ar $(AROPTIONS) $@ $(OBJECTS)
64 install: install_@WX_TARGET_LIBRARY_TYPE@
67 $(INSTALL_PROGRAM) $(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
68 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
70 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
71 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
74 $(INSTALL_PROGRAM) $(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
77 $(RM) $(libdir)/$(TARGETLIB_STATIC)
78 $(RM) $(libdir)/$(TARGETLIB_SHARED)
79 $(RM) $(libdir)/$(TARGETLIB_LINK1)
80 $(RM) $(libdir)/$(TARGETLIB_LINK2)
83 $(RM) $(OBJECTS) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
84 $(TARGETLIB_LINK2) $(TARGETLIB_STATIC) core
86 .PHONY: all shared static clean install install_static install_shared uninstall