]>
Commit | Line | Data |
---|---|---|
3711412e RL |
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 | |
8e877c19 | 29 | |
48b1d0ff RR |
30 | # Clears all default suffixes |
31 | .SUFFIXES: .o .cpp .c .cxx | |
32 | ||
33 | .c.o : | |
3711412e | 34 | $(CCC) -c $(CFLAGS) $(PICFLAGS) -o $@ $< |
48b1d0ff RR |
35 | |
36 | .cpp.o : | |
3711412e | 37 | $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $< |
48b1d0ff RR |
38 | |
39 | .cxx.o : | |
3711412e | 40 | $(CC) -c $(CPPFLAGS) $(PICFLAGS) -o $@ $< |
48b1d0ff | 41 | |
549c6f67 | 42 | include $(top_builddir)/src/make.env |
8e877c19 | 43 | |
8e877c19 | 44 | |
3711412e RL |
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) | |
8e877c19 RR |
61 | ar $(AROPTIONS) $@ $(OBJECTS) |
62 | $(RANLIB) $@ | |
63 | ||
3711412e RL |
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 | ||
8e877c19 | 82 | clean: |
3711412e RL |
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 |