root/tags/gdal_1_2_0/GNUmakefile

Revision 5886, 3.7 kB (checked in by warmerda, 4 years ago)

Fix to ensure that non-libtool, no-shared case still works in install.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2 GDAL_ROOT       =       .
3 WEB_DIR         = /web/remotesensing/gdal
4
5 include GDALmake.opt
6
7 GDAL_OBJ        =       $(GDAL_ROOT)/frmts/o/*.o \
8                         $(GDAL_ROOT)/gcore/*.o \
9                         $(GDAL_ROOT)/port/*.o \
10                         $(GDAL_ROOT)/alg/*.o
11
12 ifeq ($(OGR_ENABLED),yes)
13 GDAL_OBJ += $(GDAL_ROOT)/ogr/ogrsf_frmts/o/*.o
14 endif
15
16 include ./ogr/file.lst
17 GDAL_OBJ += $(addprefix ./ogr/,$(OBJ))
18
19 LIBGDAL-yes     :=      $(GDAL_LIB)
20 LIBGDAL-$(HAVE_LD_SHARED)       +=      $(GDAL_SLIB)
21 # override if we are using libtool
22 LIBGDAL-$(HAVE_LIBTOOL) := $(LIBGDAL)
23
24 default:        lib-target py-target apps-target
25
26 lib-target:     check-lib;
27
28 force-lib:
29         $(AR) r $(GDAL_LIB) $(GDAL_OBJ)
30         $(RANLIB) $(GDAL_LIB)
31         $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(GDAL_LIBS) $(LIBS) \
32                 -o $(GDAL_SLIB)
33
34 $(GDAL_LIB):    $(GDAL_OBJ)
35         $(AR) r $(GDAL_LIB) $(GDAL_OBJ)
36         $(RANLIB) $(GDAL_LIB)
37
38 $(GDAL_SLIB):   $(GDAL_OBJ)
39         $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(GDAL_LIBS) $(LIBS) \
40                 -o $(GDAL_SLIB)
41
42 $(LIBGDAL):     $(GDAL_OBJ:.o=.lo)
43         $(LD) $(LIBS) -o $@ $(GDAL_OBJ:.o=.lo) \
44             -rpath $(INST_LIB) \
45             -no-undefined \
46             -version-info $(LIBGDAL_CURRENT):$(LIBGDAL_REVISION):$(LIBGDAL_AGE)
47
48 check-lib:      port-target core-target frmts-target ogr-target
49         $(MAKE) $(LIBGDAL-yes)
50
51 port-target:
52         (cd port; $(MAKE))
53
54 ogr-target:
55         (cd ogr; $(MAKE) lib )
56
57 core-target:
58         (cd gcore; $(MAKE))
59         (cd alg; $(MAKE))
60
61 frmts-target:
62         (cd frmts; $(MAKE))
63
64 ogr-all:
65         (cd ogr; $(MAKE) all)
66
67 apps-target:    lib-target ogr-apps
68         (cd apps; $(MAKE))
69
70
71 ogr-apps:       lib-target
72         (cd ogr; $(MAKE) apps)
73
74 #
75 #       We only make python a default target if we think python is installed.
76 #
77 ifeq ($(PYTHON),no)
78 py-target: ;
79 else
80 py-target:      py-module;
81 endif
82
83 clean:  lclean
84         (cd port; $(MAKE) clean)
85         (cd ogr; $(MAKE) clean)
86         (cd gcore; $(MAKE) clean)
87         (cd frmts; $(MAKE) clean)
88         (cd alg; $(MAKE) clean)
89         (cd apps; $(MAKE) clean)
90         (cd pymod; $(MAKE) clean)
91
92 py-module:      lib-target
93         (cd pymod; $(MAKE))
94
95 lclean:
96         rm -f *.a *.so config.log config.cache html/*.*
97         $(RM) *.la
98
99 distclean:      dist-clean
100
101 dist-clean:     clean
102         rm -f GDALmake.opt port/cpl_config.h config.cache config.status
103         rm -f libtool
104         rm -rf autom4te.cache
105
106 config: configure
107         ./configure
108
109 configure:      configure.in aclocal.m4
110         autoconf
111
112 GDALmake.opt:   GDALmake.opt.in config.status
113         ./config.status
114
115 docs:
116         (cd ogr; $(MAKE) docs)
117         (cd html; rm -f *.*)
118         doxygen
119         cp data/gdalicon.png html
120         cp frmts/*.html frmts/*/frmt_*.html html
121
122 all:    default ogr-all
123
124 install-docs:
125         (cd ogr; $(MAKE) install-docs)
126         $(INSTALL_DIR) $(INST_DOCS)/gdal
127         cp html/*.* $(INST_DOCS)/gdal
128
129 web-update:     docs
130         cp html/*.* $(WEB_DIR)
131
132 install:        default install-actions
133
134 install-actions: install-lib
135         $(INSTALL_DIR) $(INST_BIN)
136         $(INSTALL_DIR) $(INST_DATA)
137         $(INSTALL_DIR) $(INST_INCLUDE)
138         (cd port; $(MAKE) install)
139         (cd gcore; $(MAKE) install)
140         (cd frmts; $(MAKE) install)
141         (cd alg; $(MAKE) install)
142         (cd ogr; $(MAKE) install)
143         (cd apps; $(MAKE) install)
144         (cd man; $(MAKE) install)
145 ifneq ($(PYTHON),no)
146         (cd pymod; $(MAKE) install)
147 endif
148         for f in data/*.* ; do $(INSTALL_DATA) $$f $(INST_DATA) ; done
149         $(LIBTOOL_FINISH) $(INST_LIB)
150
151 ifeq ($(HAVE_LIBTOOL),yes)
152
153 install-lib:
154         $(INSTALL_DIR) $(INST_LIB)
155         for f in $(LIBGDAL-yes) ; do $(INSTALL_LIB) $$f $(INST_LIB) ; done
156
157 else
158
159 ifeq ($(HAVE_LD_SHARED),yes)
160
161 GDAL_VER_MAJOR  =       $(firstword $(subst ., ,$(GDAL_VER)))
162 GDAL_SLIB_B     =       $(notdir $(GDAL_SLIB))
163
164 install-lib:
165         $(INSTALL_DIR) $(INST_LIB)
166         rm -f $(INST_LIB)/$(GDAL_SLIB_B)
167         rm -f $(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER_MAJOR)
168         rm -f $(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
169         $(INSTALL_LIB) $(GDAL_SLIB) $(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
170         (cd $(INST_LIB) ; \
171          ln -s $(GDAL_SLIB_B).$(GDAL_VER_MAJOR) $(GDAL_SLIB_B))
172         (cd $(INST_LIB) ; \
173          ln -s $(GDAL_SLIB_B).$(GDAL_VER) $(GDAL_SLIB_B).$(GDAL_VER_MAJOR))
174
175 else
176
177 install-lib:
178         $(INSTALL_DIR) $(INST_LIB)
179         $(INSTALL_LIB) $(GDAL_LIB) $(INST_LIB)
180
181 endif # HAVE_LD_SHARED=no
182
183
184 endif # HAVE_LIBTOOL=no
Note: See TracBrowser for help on using the browser.