2 # Template makefile for building wxWindows companion libraries.
4 # Author: Ron Lee <ron@debian.org>
8 # To use, set the following vars before including it:
24 # either a shared or static lib will be built according to the
25 # option given to configure.
29 exec_prefix = @exec_prefix@
30 includedir = @includedir@
34 INSTALL_PROGRAM = @INSTALL_PROGRAM@
35 INSTALL_DATA = @INSTALL_DATA@
37 TARGETLIB_STATIC = $(TARGET_LIBNAME).a
38 TARGETLIB_SHARED = $(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT).$(LIBVERSION_REVISION).$(LIBVERSION_AGE)
39 TARGETLIB_LINK1 = $(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT)
40 TARGETLIB_LINK2 = $(TARGET_LIBNAME).so
42 TARGETLIB_SONAME = @WX_TARGET_LIBRARY_SONAME@
44 # Clears all default suffixes
45 .SUFFIXES: .o .cpp .c .cxx
48 $(CCC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
51 $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $<
54 $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $<
56 # the comment at the end of the next line is needed because otherwise autoconf
57 # would remove this line completely - it contains a built-in hack to remove
58 # any VPATH assignment not containing ':'
59 VPATH = @PATH_IFS@$(top_srcdir)/$(libsrc_dir) # ':' for autoconf
61 include $(top_builddir)/src/make.env
64 all: libtype_@WX_TARGET_LIBRARY_TYPE@
66 libtype_so: CREATE_LINKS
68 libtype_a: $(TARGETLIB_STATIC)
71 $(TARGETLIB_SHARED): $(OBJECTS)
72 @$(INSTALL) -d $(top_builddir)/lib
73 $(SHARED_LD) $(top_builddir)/lib/$@ $(TARGETLIB_SONAME) $(OBJECTS)
75 CREATE_LINKS: $(TARGETLIB_SHARED)
76 cd $(top_builddir)/lib \
77 && $(RM) $(TARGETLIB_LINK1) $(TARGETLIB_LINK2) \
78 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
79 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
81 $(TARGETLIB_STATIC): $(OBJECTS)
82 @$(INSTALL) -d $(top_builddir)/lib
83 ar $(AROPTIONS) $(top_builddir)/lib/$@ $(OBJECTS)
84 $(RANLIB) $(top_builddir)/lib/$@
86 install: install_@WX_TARGET_LIBRARY_TYPE@ install_headers
89 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
90 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
92 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
93 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
96 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
99 $(INSTALL) -d $(includedir)/wx/$(HEADER_SUBDIR)
100 @for h in $(HEADERS); do \
101 $(INSTALL_DATA) $(HEADER_PATH)/$(HEADER_SUBDIR)/$$h $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
102 echo "installing $(includedir)/wx/$(HEADER_SUBDIR)/$$h"; \
106 $(RM) $(libdir)/$(TARGETLIB_STATIC)
107 $(RM) $(libdir)/$(TARGETLIB_SHARED)
108 $(RM) $(libdir)/$(TARGETLIB_LINK1)
109 $(RM) $(libdir)/$(TARGETLIB_LINK2)
110 @echo "removing headers"
111 @for h in $(HEADERS); do \
112 $(RM) $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
114 @if test -d $(includedir)/wx/$(HEADER_SUBDIR); then \
115 rmdir $(includedir)/wx/$(HEADER_SUBDIR); \
117 @-rmdir $(includedir)/wx
120 $(RM) $(OBJECTS) $(top_builddir)/lib/$(TARGETLIB_SHARED) \
121 $(top_builddir)/lib/$(TARGETLIB_LINK1) \
122 $(top_builddir)/lib/$(TARGETLIB_LINK2) \
123 $(top_builddir)/lib/$(TARGETLIB_STATIC) core
125 .PHONY: all shared static clean install install_static install_shared uninstall