]>
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 | |
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 | ||
28 | prefix = @prefix@ | |
29 | exec_prefix = @exec_prefix@ | |
f6bcfd97 | 30 | includedir = @includedir@ |
3711412e RL |
31 | libdir = @libdir@ |
32 | ||
33 | INSTALL = @INSTALL@ | |
34 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
f6bcfd97 | 35 | INSTALL_DATA = @INSTALL_DATA@ |
3711412e | 36 | |
3a922bb4 RL |
37 | TARGETLIB_STATIC = $(TARGET_LIBNAME).a |
38 | TARGETLIB_SHARED = $(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT).$(LIBVERSION_REVISION).$(LIBVERSION_AGE) | |
39 | TARGETLIB_LINK1 = $(TARGET_LIBNAME).so.$(LIBVERSION_CURRENT) | |
40 | TARGETLIB_LINK2 = $(TARGET_LIBNAME).so | |
f6bcfd97 BP |
41 | |
42 | TARGETLIB_SONAME = @WX_TARGET_LIBRARY_SONAME@ | |
8e877c19 | 43 | |
3a922bb4 RL |
44 | %.o : %.c |
45 | $(CC) -c $(CFLAGS) $(PICFLAGS) -o $@ $< | |
48b1d0ff | 46 | |
3a922bb4 RL |
47 | %.o : %.cpp |
48 | $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $< | |
48b1d0ff | 49 | |
3a922bb4 RL |
50 | %.o : %.cxx |
51 | $(CXX) -c $(CXXFLAGS) $(PICFLAGS) -o $@ $< | |
48b1d0ff | 52 | |
f6bcfd97 BP |
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 ':' | |
3a922bb4 | 56 | VPATH = @PATH_IFS@$(top_srcdir)/$(libsrc_dir) # ':' for autoconf |
f6bcfd97 | 57 | |
3a922bb4 | 58 | include $(top_builddir)/src/make.env |
8e877c19 | 59 | |
8e877c19 | 60 | |
f6bcfd97 | 61 | all: libtype_@WX_TARGET_LIBRARY_TYPE@ |
3711412e | 62 | |
3a922bb4 | 63 | libtype_so: $(top_builddir)/lib/$(TARGETLIB_SHARED) |
3711412e | 64 | |
3a922bb4 | 65 | libtype_a: $(top_builddir)/lib/$(TARGETLIB_STATIC) |
3711412e | 66 | |
3711412e | 67 | |
3a922bb4 RL |
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) | |
3711412e | 75 | |
3a922bb4 RL |
76 | $(top_builddir)/lib/$(TARGETLIB_STATIC): $(OBJECTS) |
77 | @$(INSTALL) -d $(top_builddir)/lib | |
c3417472 GD |
78 | @$(RM) $@ |
79 | $(AR) $(AROPTIONS) $@ $(OBJECTS) | |
3a922bb4 | 80 | $(RANLIB) $@ |
8e877c19 | 81 | |
f6bcfd97 | 82 | install: install_@WX_TARGET_LIBRARY_TYPE@ install_headers |
3711412e RL |
83 | |
84 | install_so: | |
3a922bb4 RL |
85 | $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_SHARED) $(libdir)/$(TARGETLIB_SHARED) |
86 | @$(RM) $(libdir)/$(TARGETLIB_LINK1) $(libdir)/$(TARGETLIB_LINK2) | |
87 | cd $(libdir) \ | |
88 | && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK1) \ | |
89 | && $(LN_S) $(TARGETLIB_SHARED) $(TARGETLIB_LINK2) | |
3711412e RL |
90 | |
91 | install_a: | |
3a922bb4 | 92 | $(INSTALL_PROGRAM) $(top_builddir)/lib/$(TARGETLIB_STATIC) $(libdir)/$(TARGETLIB_STATIC) |
f6bcfd97 BP |
93 | |
94 | install_headers: | |
3a922bb4 RL |
95 | $(INSTALL) -d $(includedir)/wx/$(HEADER_SUBDIR) |
96 | @for h in $(HEADERS); do \ | |
97 | $(INSTALL_DATA) $(HEADER_PATH)/$(HEADER_SUBDIR)/$$h $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \ | |
98 | echo "installing $(includedir)/wx/$(HEADER_SUBDIR)/$$h"; \ | |
f6bcfd97 | 99 | done |
3711412e RL |
100 | |
101 | uninstall: | |
3a922bb4 RL |
102 | $(RM) $(libdir)/$(TARGETLIB_STATIC) |
103 | $(RM) $(libdir)/$(TARGETLIB_SHARED) | |
104 | $(RM) $(libdir)/$(TARGETLIB_LINK1) | |
105 | $(RM) $(libdir)/$(TARGETLIB_LINK2) | |
f6bcfd97 | 106 | @echo "removing headers" |
3a922bb4 RL |
107 | @for h in $(HEADERS); do \ |
108 | $(RM) $(includedir)/wx/$(HEADER_SUBDIR)/$$h; \ | |
f6bcfd97 | 109 | done |
3a922bb4 RL |
110 | @if test -d $(includedir)/wx/$(HEADER_SUBDIR); then \ |
111 | rmdir $(includedir)/wx/$(HEADER_SUBDIR); \ | |
f6bcfd97 | 112 | fi |
3a922bb4 | 113 | @-rmdir $(includedir)/wx |
3711412e | 114 | |
8e877c19 | 115 | clean: |
3a922bb4 RL |
116 | $(RM) $(OBJECTS) $(top_builddir)/lib/$(TARGETLIB_SHARED) \ |
117 | $(top_builddir)/lib/$(TARGETLIB_LINK1) \ | |
118 | $(top_builddir)/lib/$(TARGETLIB_LINK2) \ | |
119 | $(top_builddir)/lib/$(TARGETLIB_STATIC) core | |
3711412e | 120 | |
3a922bb4 | 121 | .PHONY: all libtype_so libtype_a install install_so install_a install_headers uninstall clean |
3711412e | 122 |