1
2
3EXTRAFLAGS = -Idegrib/degrib -I../mem
4
5include ../../GDALmake.opt
6
7OBJ	=	gribdataset.o gribcreatecopy.o \
8                clock.o \
9                degrib1.o \
10                degrib2.o inventory.o metaname.o myerror.o grib1tab.o myutil.o metaparse.o weather.o metaprint.o grib2api.o myassert.o scan.o tendian.o gridtemplates.o drstemplates.o pdstemplates.o gbits.o g2_free.o g2_unpack1.o g2_unpack2.o g2_unpack3.o g2_unpack4.o g2_unpack5.o g2_unpack6.o g2_unpack7.o g2_info.o g2_getfld.o simunpack.o comunpack.o pack_gp.o reduce.o specunpack.o rdieee.o mkieee.o int_power.o simpack.o compack.o cmplxpack.o misspack.o \
11		dec_jpeg2000.o jpcunpack.o hazard.o
12
13ifeq ($(PNG_SETTING),internal)
14EXTRAFLAGS      :=      $(EXTRAFLAGS) -I../png/libpng -DUSE_PNG
15ifeq ($(LIBZ_SETTING),internal)
16EXTRAFLAGS      :=      $(EXTRAFLAGS) -I../zlib
17endif
18OBJ     :=      $(OBJ) pngunpack.o dec_png.o
19endif
20
21ifeq ($(PNG_SETTING),external)
22EXTRAFLAGS      :=      $(EXTRAFLAGS) -DUSE_PNG
23OBJ     :=      $(OBJ) pngunpack.o dec_png.o
24endif
25
26CPPFLAGS	:=	 $(EXTRAFLAGS) $(CPPFLAGS)
27
28default:	$(OBJ:.o=.$(OBJ_EXT))
29
30../o/%.$(OBJ_EXT):	degrib/degrib/%.c
31	$(CC) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -Idegrib/g2clib $< -o $@
32
33../o/%.$(OBJ_EXT):	degrib/degrib/%.cpp
34	$(CXX) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $< -o $@
35
36../o/%.$(OBJ_EXT):	degrib/g2clib/%.c
37	$(CC) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $< -o $@
38
39../o/%.$(OBJ_EXT):	degrib/g2clib/%.cpp
40	$(CXX) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $< -o $@
41
42%.$(OBJ_EXT):	degrib/degrib/%.c
43	$(CC) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -Idegrib/g2clib $< -o $@
44
45%.$(OBJ_EXT):	degrib/degrib/%.cpp
46	$(CXX) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $< -o $@
47
48%.$(OBJ_EXT):	degrib/g2clib/%.c
49	$(CC) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $< -o $@
50
51%.$(OBJ_EXT):	degrib/g2clib/%.cpp
52	$(CXX) -c $(GDAL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $< -o $@
53
54defaultold:	$(OBJ:.o=.$(OBJ_EXT))
55	(cd degrib/degrib; $(MAKE)); cd ../..
56	(cd degrib/g2clib; $(MAKE))
57clean:
58	rm -f *.o $(O_OBJ)
59
60install-obj:	$(O_OBJ:.o=.$(OBJ_EXT))
61
62plugin: gdal_GRIB.so
63
64gdal_GRIB.so:	$(OBJ)
65	$(LD_SHARED) $(OBJ) $(GDAL_LIBS) $(LIBS) -o gdal_GRIB.so
66
67
68
69