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 # NB: see remark in Makefile.in as to why we don't use %.foo: %.bar rules
45 .SUFFIXES: .o .c .cpp .cxx
48 $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
51 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
54 $(CXX) -c $(CXXFLAGS) $(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
63 all: libtype_@WX_TARGET_LIBRARY_TYPE@
65 libtype_so: $(top_builddir)/lib/$(TARGETLIB_SHARED)
67 libtype_a: $(top_builddir)/lib/$(TARGETLIB_STATIC)
69 $(top_builddir)/lib/$(TARGETLIB_SHARED): $(OBJECTS)
70 @$(INSTALL) -d $(top_builddir)/lib
71 $(SHARED_LD) $@ $(TARGETLIB_SONAME) $(OBJECTS)
72 cd $(top_builddir)/lib \
73 && $(RM) $(TARGETLIB_LINK1) $(TARGETLIB_LINK2) \
74 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
75 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
77 $(top_builddir)/lib/$(TARGETLIB_STATIC): $(OBJECTS)
78 @$(INSTALL) -d $(top_builddir)/lib
80 $(AR) $(AROPTIONS) $@ $(OBJECTS)
83 install: install_@WX_TARGET_LIBRARY_TYPE@ install_headers
86 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
87 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
89 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
90 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
93 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
96 $(INSTALL) -d $(includedir)/wx/$(HEADER_SUBDIR)
97 @for h in $(HEADERS); do \
98 $(INSTALL_DATA) $(HEADER_PATH)/$(HEADER_SUBDIR)/$$h $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
99 echo "installing $(includedir)/wx/$(HEADER_SUBDIR)/$$h"; \
103 $(RM) $(libdir)/$(TARGETLIB_STATIC)
104 $(RM) $(libdir)/$(TARGETLIB_SHARED)
105 $(RM) $(libdir)/$(TARGETLIB_LINK1)
106 $(RM) $(libdir)/$(TARGETLIB_LINK2)
107 @echo "removing headers"
108 @for h in $(HEADERS); do \
109 $(RM) $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
111 @if test -d $(includedir)/wx/$(HEADER_SUBDIR); then \
112 rmdir $(includedir)/wx/$(HEADER_SUBDIR); \
114 @-rmdir $(includedir)/wx
117 $(RM) $(OBJECTS) $(top_builddir)/lib/$(TARGETLIB_SHARED) \
118 $(top_builddir)/lib/$(TARGETLIB_LINK1) \
119 $(top_builddir)/lib/$(TARGETLIB_LINK2) \
120 $(top_builddir)/lib/$(TARGETLIB_STATIC) core
122 .PHONY: all libtype_so libtype_a install install_so install_a install_headers uninstall clean