root/tags/gdal_1_3_2/GNUmakefile

Revision 9372, 4.5 kB (checked in by dron, 3 years ago)

GDAL_ROOT definition moved to GDALmake.opt.in.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2 WEB_DIR         = $(HOME)/www/gdal
3
4 include GDALmake.opt
5
6 GDAL_OBJ        =       $(GDAL_ROOT)/frmts/o/*.o \
7                         $(GDAL_ROOT)/gcore/*.o \
8                         $(GDAL_ROOT)/port/*.o \
9                         $(GDAL_ROOT)/alg/*.o
10
11 ifeq ($(OGR_ENABLED),yes)
12 GDAL_OBJ += $(GDAL_ROOT)/ogr/ogrsf_frmts/o/*.o
13 endif
14
15 include ./ogr/file.lst
16 GDAL_OBJ += $(addprefix ./ogr/,$(OBJ))
17
18 LIBGDAL-yes     :=      $(GDAL_LIB)
19 LIBGDAL-$(HAVE_LD_SHARED)       +=      $(GDAL_SLIB)
20 # override if we are using libtool
21 LIBGDAL-$(HAVE_LIBTOOL) := $(LIBGDAL)
22
23 default:        lib-target py-target apps-target
24
25 lib-target:     check-lib;
26
27 force-lib:
28         $(AR) r $(GDAL_LIB) $(GDAL_OBJ)
29         $(RANLIB) $(GDAL_LIB)
30         $(LD_SHARED) $(GDAL_SLIB_SONAME) $(GDAL_OBJ) $(GDAL_LIBS) $(LIBS) \
31                 -o $(GDAL_SLIB)
32
33 $(GDAL_LIB):    $(GDAL_OBJ) GDALmake.opt
34         rm -f libgdal.a
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 #
76 #       We only make python a default target if we think python is installed.
77 #
78 ifeq ($(PYTHON),no)
79 py-target: ;
80 else
81 py-target:      py-module;
82 endif
83
84 swig-target:
85 ifneq ($(BINDINGS),)
86         (cd swig; $(MAKE) build)
87 endif
88
89 clean:  lclean
90         (cd port; $(MAKE) clean)
91         (cd ogr; $(MAKE) clean)
92         (cd gcore; $(MAKE) clean)
93         (cd frmts; $(MAKE) clean)
94         (cd alg; $(MAKE) clean)
95         (cd apps; $(MAKE) clean)
96 ifneq ($(BINDINGS),)
97         (cd swig; $(MAKE) clean)
98 endif
99         (cd pymod; $(MAKE) clean)
100
101 py-module:      lib-target
102         (cd pymod; $(MAKE))
103
104 lclean:
105         rm -f *.a *.so config.log config.cache html/*.*
106         $(RM) *.la
107
108 distclean:      dist-clean
109
110 dist-clean:     clean
111         rm -f GDALmake.opt port/cpl_config.h config.cache config.status
112         rm -f libtool
113         rm -rf autom4te.cache
114
115 config: configure
116         ./configure
117
118 configure:      configure.in aclocal.m4
119         autoconf
120
121 GDALmake.opt:   GDALmake.opt.in config.status
122         ./config.status
123
124 docs:
125         (cd ogr; $(MAKE) docs)
126         (cd html; rm -f *.*)
127 # Generate translated docs. Should go first, because index.html page should
128 # be overwritten with the main one later
129         doxygen -w html html/header.html html/footer.html html/stylesheet.css
130         sed -e 's,iso-8859-1,koi8-r,g' html/header.html > html/header_ru.html
131         (cat Doxyfile ; echo "HTML_HEADER=html/header_ru.html"; echo "INPUT=doc/ru"; echo "OUTPUT_LANGUAGE=Russian") | doxygen -
132 # Generate HTML docs
133         doxygen Doxyfile
134 # Generate man pages
135         (cat Doxyfile ; echo "ENABLED_SECTIONS=man"; echo "INPUT=doc ogr"; echo "FILE_PATTERNS=*utilities.dox"; echo "GENERATE_HTML=NO"; echo "GENERATE_MAN=YES") | doxygen -
136         cp data/gdalicon.png html
137         cp doc/ERMapperlogo_small.gif html
138         cp frmts/*.html frmts/*/frmt_*.html html
139
140 all:    default ogr-all
141
142 install-docs:
143         (cd ogr; $(MAKE) install-docs)
144         $(INSTALL_DIR) $(INST_DOCS)/gdal
145         cp html/*.* $(INST_DOCS)/gdal
146
147 web-update:     docs
148         cp html/*.* $(WEB_DIR)
149
150 install:        default install-actions
151
152 install-actions: install-lib
153         $(INSTALL_DIR) $(INST_BIN)
154         $(INSTALL_DIR) $(INST_DATA)
155         $(INSTALL_DIR) $(INST_INCLUDE)
156         (cd port; $(MAKE) install)
157         (cd gcore; $(MAKE) install)
158         (cd frmts; $(MAKE) install)
159         (cd alg; $(MAKE) install)
160         (cd ogr; $(MAKE) install)
161         (cd apps; $(MAKE) install)
162         (cd man; $(MAKE) install)
163 ifneq ($(PYTHON),no)
164         (cd pymod; $(MAKE) install)
165 endif
166 ifneq ($(BINDINGS),)
167         (cd swig; $(MAKE) install)
168 endif
169         for f in data/*.* ; do $(INSTALL_DATA) $$f $(INST_DATA) ; done
170         $(LIBTOOL_FINISH) $(INST_LIB)
171
172 ifeq ($(HAVE_LIBTOOL),yes)
173
174 install-lib:
175         $(INSTALL_DIR) $(INST_LIB)
176         for f in $(LIBGDAL-yes) ; do $(INSTALL_LIB) $$f $(INST_LIB) ; done
177
178 else
179
180 ifeq ($(HAVE_LD_SHARED),yes)
181
182 GDAL_VER_MAJOR  =       $(firstword $(subst ., ,$(GDAL_VER)))
183 GDAL_SLIB_B     =       $(notdir $(GDAL_SLIB))
184
185 install-lib:
186         $(INSTALL_DIR) $(INST_LIB)
187         rm -f $(INST_LIB)/$(GDAL_SLIB_B)
188         rm -f $(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER_MAJOR)
189         rm -f $(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
190         $(INSTALL_LIB) $(GDAL_SLIB) $(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
191         (cd $(INST_LIB) ; \
192          ln -s $(GDAL_SLIB_B).$(GDAL_VER_MAJOR) $(GDAL_SLIB_B))
193         (cd $(INST_LIB) ; \
194          ln -s $(GDAL_SLIB_B).$(GDAL_VER) $(GDAL_SLIB_B).$(GDAL_VER_MAJOR))
195
196 else
197
198 install-lib:
199         $(INSTALL_DIR) $(INST_LIB)
200         $(INSTALL_LIB) $(GDAL_LIB) $(INST_LIB)
201
202 endif # HAVE_LD_SHARED=no
203
204
205 endif # HAVE_LIBTOOL=no
Note: See TracBrowser for help on using the browser.