]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/makelib.env.in
added missing -univ package control files.
[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
44%.o : %.c
45 $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
46
47%.o : %.cpp
48 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
49
50%.o : %.cxx
51 $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $<
52
53# the comment at the end of the next line is needed because otherwise autoconf
54# would remove this line completely - it contains a built-in hack to remove
55# any VPATH assignment not containing ':'
56VPATH = @PATH_IFS@$(top_srcdir)/$(libsrc_dir) # ':' for autoconf
57
58include $(top_builddir)/src/make.env
59
60
61all: libtype_@WX_TARGET_LIBRARY_TYPE@
62
63libtype_so: $(top_builddir)/lib/$(TARGETLIB_SHARED)
64
65libtype_a: $(top_builddir)/lib/$(TARGETLIB_STATIC)
66
67
68$(top_builddir)/lib/$(TARGETLIB_SHARED): $(OBJECTS)
69 @$(INSTALL) -d $(top_builddir)/lib
70 $(SHARED_LD) $@ $(TARGETLIB_SONAME) $(OBJECTS)
71 cd $(top_builddir)/lib \
72 && $(RM) $(TARGETLIB_LINK1) $(TARGETLIB_LINK2) \
73 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
74 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
75
76$(top_builddir)/lib/$(TARGETLIB_STATIC): $(OBJECTS)
77 @$(INSTALL) -d $(top_builddir)/lib
78 ar $(AROPTIONS) $@ $(OBJECTS)
79 $(RANLIB) $@
80
81install: install_@WX_TARGET_LIBRARY_TYPE@ install_headers
82
83install_so:
84 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
85 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
86 cd $(libdir) \
87 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
88 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
89
90install_a:
91 $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
92
93install_headers:
94 $(INSTALL) -d $(includedir)/wx/$(HEADER_SUBDIR)
95 @for h in $(HEADERS); do \
96 $(INSTALL_DATA) $(HEADER_PATH)/$(HEADER_SUBDIR)/$$h $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
97 echo "installing $(includedir)/wx/$(HEADER_SUBDIR)/$$h"; \
98 done
99
100uninstall:
101 $(RM) $(libdir)/$(TARGETLIB_STATIC)
102 $(RM) $(libdir)/$(TARGETLIB_SHARED)
103 $(RM) $(libdir)/$(TARGETLIB_LINK1)
104 $(RM) $(libdir)/$(TARGETLIB_LINK2)
105 @echo "removing headers"
106 @for h in $(HEADERS); do \
107 $(RM) $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \
108 done
109 @if test -d $(includedir)/wx/$(HEADER_SUBDIR); then \
110 rmdir $(includedir)/wx/$(HEADER_SUBDIR); \
111 fi
112 @-rmdir $(includedir)/wx
113
114clean:
115 $(RM) $(OBJECTS) $(top_builddir)/lib/$(TARGETLIB_SHARED) \
116 $(top_builddir)/lib/$(TARGETLIB_LINK1) \
117 $(top_builddir)/lib/$(TARGETLIB_LINK2) \
118 $(top_builddir)/lib/$(TARGETLIB_STATIC) core
119
120.PHONY: all libtype_so libtype_a install install_so install_a install_headers uninstall clean
121