]> git.saurik.com Git - wxWidgets.git/blame - src/makelib.env.in
Clear attribute cache in Redimension to fix Bug 508407.
[wxWidgets.git] / src / makelib.env.in
CommitLineData
3711412e
RL
1#
2# Template makefile for building wxWindows companion libraries.
3#
4# Author: Ron Lee <ron@debian.org>
5# Created: 19/3/2000
f6bcfd97 6# $Id$
3711412e 7#
f6bcfd97
BP
8# To use, set the following vars before including it:
9#
10# top_srcdir
11# top_builddir
12# libsrc_dir
3711412e
RL
13#
14# TARGET_LIBNAME
15# LIBVERSION_CURRENT
16# LIBVERSION_REVISION
17# LIBVERSION_AGE
f6bcfd97
BP
18# HEADER_PATH
19# HEADER_SUBDIR
20#
21# HEADERS
22# OBJECTS
3711412e
RL
23#
24# either a shared or static lib will be built according to the
25# option given to configure.
26#
27
28prefix = @prefix@
29exec_prefix = @exec_prefix@
f6bcfd97 30includedir = @includedir@
3711412e
RL
31libdir = @libdir@
32
33INSTALL = @INSTALL@
34INSTALL_PROGRAM = @INSTALL_PROGRAM@
f6bcfd97 35INSTALL_DATA = @INSTALL_DATA@
3711412e 36
3a922bb4
RL
37TARGETLIB_STATIC = $(TARGET_LIBNAME).a
38TARGETLIB_SHARED = $(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT).$(LIBVERSION_REVISION).$(LIBVERSION_AGE)
39TARGETLIB_LINK1 = $(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT)
40TARGETLIB_LINK2 = $(TARGET_LIBNAME).so
f6bcfd97
BP
41
42TARGETLIB_SONAME = @WX_TARGET_LIBRARY_SONAME@
8e877c19 43
f5be30b7
VZ
44# NB: see remark in Makefile.in as to why we don't use %.foo: %.bar rules
45.SUFFIXES: .o .c .cpp .cxx
46
47.c.o:
3a922bb4 48 $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
48b1d0ff 49
f5be30b7 50.cpp.o:
3a922bb4 51 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
48b1d0ff 52
f5be30b7 53.cxx.o:
3a922bb4 54 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
48b1d0ff 55
f6bcfd97
BP
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 ':'
3a922bb4 59VPATH = @PATH_IFS@$(top_srcdir)/$(libsrc_dir) # ':' for autoconf
f6bcfd97 60
3a922bb4 61include $(top_builddir)/src/make.env
8e877c19 62
f6bcfd97 63all: libtype_@WX_TARGET_LIBRARY_TYPE@
3711412e 64
3a922bb4 65libtype_so: $(top_builddir)/lib/$(TARGETLIB_SHARED)
3711412e 66
3a922bb4 67libtype_a: $(top_builddir)/lib/$(TARGETLIB_STATIC)
3711412e 68
2dc5bacc 69$(top_builddir)/lib/$(TARGETLIB_SHARED): $(OBJECTS)
3a922bb4 70 @$(INSTALL) -d $(top_builddir)/lib
2dc5bacc 71 $(SHARED_LD) $@ $(TARGETLIB_SONAME) $(OBJECTS)
3a922bb4
RL
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)
3711412e 76
3a922bb4
RL
77$(top_builddir)/lib/$(TARGETLIB_STATIC): $(OBJECTS)
78 @$(INSTALL) -d $(top_builddir)/lib
c3417472
GD
79 @$(RM) $@
80 $(AR) $(AROPTIONS) $@ $(OBJECTS)
3a922bb4 81 $(RANLIB) $@
8e877c19 82
f6bcfd97 83install: install_@WX_TARGET_LIBRARY_TYPE@ install_headers
3711412e
RL
84
85install_so:
3a922bb4
RL
86 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
87 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
88 cd $(libdir) \
89 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
90 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
3711412e
RL
91
92install_a:
3a922bb4 93 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
f6bcfd97
BP
94
95install_headers:
3a922bb4
RL
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"; \
f6bcfd97 100 done
3711412e
RL
101
102uninstall:
3a922bb4
RL
103 $(RM) $(libdir)/$(TARGETLIB_STATIC)
104 $(RM) $(libdir)/$(TARGETLIB_SHARED)
105 $(RM) $(libdir)/$(TARGETLIB_LINK1)
106 $(RM) $(libdir)/$(TARGETLIB_LINK2)
f6bcfd97 107 @echo "removing headers"
3a922bb4
RL
108 @for h in $(HEADERS); do \
109 $(RM) $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
f6bcfd97 110 done
3a922bb4
RL
111 @if test -d $(includedir)/wx/$(HEADER_SUBDIR); then \
112 rmdir $(includedir)/wx/$(HEADER_SUBDIR); \
f6bcfd97 113 fi
3a922bb4 114 @-rmdir $(includedir)/wx
3711412e 115
8e877c19 116clean:
3a922bb4
RL
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
3711412e 121
3a922bb4 122.PHONY: all libtype_so libtype_a install install_so install_a install_headers uninstall clean
3711412e 123