]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/makelib.env.in
compilation fix for Mac and reformatted the code
[wxWidgets.git] / src / makelib.env.in
... / ...
CommitLineData
1#
2# Template makefile for building wxWindows companion libraries.
3#
4# Author: Ron Lee <ron@debian.org>
5# Created: 19/3/2000
6# $Id$
7#
8# To use, set the following vars before including it:
9#
10# top_srcdir
11# top_builddir
12# libsrc_dir
13#
14# TARGET_LIBNAME
15# LIBVERSION_CURRENT
16# LIBVERSION_REVISION
17# LIBVERSION_AGE
18# HEADER_PATH
19# HEADER_SUBDIR
20#
21# HEADERS
22# OBJECTS
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@
30includedir = @includedir@
31libdir = @libdir@
32
33INSTALL = @INSTALL@
34INSTALL_PROGRAM = @INSTALL_PROGRAM@
35INSTALL_DATA = @INSTALL_DATA@
36
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
41
42TARGETLIB_SONAME = @WX_TARGET_LIBRARY_SONAME@
43
44LDFLAGS_VERSIONING = @LDFLAGS_VERSIONING@
45
46# NB: see remark in Makefile.in as to why we don't use %.foo: %.bar rules
47.SUFFIXES: .o .c .cpp .cxx
48
49.c.o:
50 $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
51
52.cpp.o:
53 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
54
55.cxx.o:
56 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
57
58# the comment at the end of the next line is needed because otherwise autoconf
59# would remove this line completely - it contains a built-in hack to remove
60# any VPATH assignment not containing ':'
61VPATH = @PATH_IFS@$(top_srcdir)/$(libsrc_dir) # ':' for autoconf
62
63include $(top_builddir)/src/make.env
64
65all: libtype_@WX_TARGET_LIBRARY_TYPE@
66
67libtype_so: $(top_builddir)/lib/$(TARGETLIB_SHARED)
68
69libtype_a: $(top_builddir)/lib/$(TARGETLIB_STATIC)
70
71$(top_builddir)/lib/$(TARGETLIB_SHARED): $(OBJECTS)
72 @$(INSTALL) -d $(top_builddir)/lib
73 $(SHARED_LD) $@ $(TARGETLIB_SONAME) $(OBJECTS) $(LDFLAGS_VERSIONING)
74 cd $(top_builddir)/lib \
75 && $(RM) $(TARGETLIB_LINK1) $(TARGETLIB_LINK2) \
76 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
77 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
78
79$(top_builddir)/lib/$(TARGETLIB_STATIC): $(OBJECTS)
80 @$(INSTALL) -d $(top_builddir)/lib
81 @$(RM) $@
82 $(AR) $(AROPTIONS) $@ $(OBJECTS)
83 $(RANLIB) $@
84
85install: install_@WX_TARGET_LIBRARY_TYPE@ install_headers
86
87install_so:
88 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
89 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
90 cd $(libdir) \
91 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
92 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
93
94install_a:
95 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
96
97install_headers:
98 $(INSTALL) -d $(includedir)/wx/$(HEADER_SUBDIR)
99 @for h in $(HEADERS); do \
100 $(INSTALL_DATA) $(HEADER_PATH)/$(HEADER_SUBDIR)/$$h $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
101 echo "installing $(includedir)/wx/$(HEADER_SUBDIR)/$$h"; \
102 done
103
104uninstall:
105 $(RM) $(libdir)/$(TARGETLIB_STATIC)
106 $(RM) $(libdir)/$(TARGETLIB_SHARED)
107 $(RM) $(libdir)/$(TARGETLIB_LINK1)
108 $(RM) $(libdir)/$(TARGETLIB_LINK2)
109 @echo "removing headers"
110 @for h in $(HEADERS); do \
111 $(RM) $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
112 done
113 @if test -d $(includedir)/wx/$(HEADER_SUBDIR); then \
114 rmdir $(includedir)/wx/$(HEADER_SUBDIR); \
115 fi
116 @-rmdir $(includedir)/wx
117
118clean:
119 $(RM) $(OBJECTS) $(top_builddir)/lib/$(TARGETLIB_SHARED) \
120 $(top_builddir)/lib/$(TARGETLIB_LINK1) \
121 $(top_builddir)/lib/$(TARGETLIB_LINK2) \
122 $(top_builddir)/lib/$(TARGETLIB_STATIC) core
123
124.PHONY: all libtype_so libtype_a install install_so install_a install_headers uninstall clean
125