]> git.saurik.com Git - wxWidgets.git/blob - src/makelib.env.in
Misc small changes
[wxWidgets.git] / src / makelib.env.in
1 #
2 # Template makefile for building wxWindows companion libraries.
3 #
4 # Author: Ron Lee <ron@debian.org>
5 # Created: 19/3/2000
6 #
7 # To use, set the following vars before including it.
8 #
9 # TARGET_LIBNAME
10 # LIBVERSION_CURRENT
11 # LIBVERSION_REVISION
12 # LIBVERSION_AGE
13 #
14 # either a shared or static lib will be built according to the
15 # option given to configure.
16 #
17
18 prefix = @prefix@
19 exec_prefix = @exec_prefix@
20 libdir = @libdir@
21
22 INSTALL = @INSTALL@
23 INSTALL_PROGRAM = @INSTALL_PROGRAM@
24
25 TARGETLIB_STATIC=$(TARGET_LIBNAME).a
26 TARGETLIB_SHARED=$(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT).$(LIBVERSION_REVISION).$(LIBVERSION_AGE)
27 TARGETLIB_LINK1=$(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT)
28 TARGETLIB_LINK2=$(TARGET_LIBNAME).so
29
30 # Clears all default suffixes
31 .SUFFIXES: .o .cpp .c .cxx
32
33 .c.o :
34 $(CCC) -c $(CFLAGS) $(PICFLAGS) -o $@ $<
35
36 .cpp.o :
37 $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $<
38
39 .cxx.o :
40 $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $<
41
42 include $(top_builddir)/src/make.env
43
44
45 all: libtype_@WX_TARGET_LIBRARY_TYPE@
46
47 libtype_so: CREATE_LINKS
48
49 libtype_a: $(TARGETLIB_STATIC)
50
51
52 $(TARGETLIB_SHARED): $(OBJECTS)
53 $(SHARED_LD) $@ $(OBJECTS)
54
55 CREATE_LINKS: $(TARGETLIB_SHARED)
56 @$(RM) $(TARGETLIB_LINK1) $(TARGETLIB_LINK2)
57 $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1)
58 $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
59
60 $(TARGETLIB_STATIC): $(OBJECTS)
61 ar $(AROPTIONS) $@ $(OBJECTS)
62 $(RANLIB) $@
63
64 install: install_@WX_TARGET_LIBRARY_TYPE@
65
66 install_so:
67 $(INSTALL_PROGRAM) $(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED)
68 @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2)
69 cd $(libdir) \
70 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
71 && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2)
72
73 install_a:
74 $(INSTALL_PROGRAM) $(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC)
75
76 uninstall:
77 $(RM) $(libdir)/$(TARGETLIB_STATIC)
78 $(RM) $(libdir)/$(TARGETLIB_SHARED)
79 $(RM) $(libdir)/$(TARGETLIB_LINK1)
80 $(RM) $(libdir)/$(TARGETLIB_LINK2)
81
82 clean:
83 $(RM) $(OBJECTS) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \
84 $(TARGETLIB_LINK2) $(TARGETLIB_STATIC) core
85
86 .PHONY: all shared static clean install install_static install_shared uninstall
87