GDAL_ROOT = . !INCLUDE nmake.opt ############################################################################## # The following determines whether we are linking all the OGR formats # into the DLL, or only the minimum spatial reference related stuff required # for a raster-gdal build. #OGR_BASE_INCLUDE = /INCLUDE:_OCTNewCoordinateTransformation@8 \ # /INCLUDE:_OSRValidate@4 \ # /INCLUDE:_OPTGetProjectionMethods@0 \ # /INCLUDE:_OGR_G_GetPointCount@4 OGR_BASE_INCLUDE = /INCLUDE:$(SYM_PREFIX)OSRValidate \ /INCLUDE:$(SYM_PREFIX)OPTGetProjectionMethods \ /INCLUDE:$(SYM_PREFIX)OGR_G_GetPointCount OGR_OBJ = ogr\ogrsf_frmts\ogrsf_frmts.lib ogr\ogr.lib OGR_INCLUDE = $(OGR_BASE_INCLUDE) \ /INCLUDE:$(SYM_PREFIX)OGRRegisterAll !IFDEF INCLUDE_GNM_FRMTS CPPFLAGS = $(CPPFLAGS) -DGNM_ENABLED !ENDIF !IF DEFINED(STDCALL) && !DEFINED(WIN64) BASE_INCLUDE = /INCLUDE:_GDALSimpleImageWarp@36 \ /INCLUDE:_GDALReprojectImage@48 \ /INCLUDE:_GDALComputeMedianCutPCT@32 \ /INCLUDE:_GDALDitherRGB2PCT@28 \ /INCLUDE:_OCTNewCoordinateTransformation@8 !ELSE BASE_INCLUDE = /INCLUDE:$(SYM_PREFIX)GDALSimpleImageWarp \ /INCLUDE:$(SYM_PREFIX)GDALReprojectImage \ /INCLUDE:$(SYM_PREFIX)GDALComputeMedianCutPCT \ /INCLUDE:$(SYM_PREFIX)GDALDitherRGB2PCT \ /INCLUDE:$(SYM_PREFIX)OCTNewCoordinateTransformation !ENDIF APPS_OBJ = apps\commonutils.obj apps\gdalinfo_lib.obj apps\gdal_translate_lib.obj apps\gdalwarp_lib.obj apps\ogr2ogr_lib.obj \ apps\gdaldem_lib.obj apps\nearblack_lib.obj apps\gdal_grid_lib.obj apps\gdal_rasterize_lib.obj apps\gdalbuildvrt_lib.obj LIBOBJ = port\*.obj gcore\*.obj alg\*.obj frmts\o\*.obj $(OGR_OBJ) gnm\*.obj gnm\gnm_frmts\o\*.obj third_party\o\*.obj $(APPS_OBJ) LIB_DEPENDS = port_dir core_dir ogr_dir gnm_dir third_party_dir frmts_dir appslib-target DISTDIR = gdal_$(VERSION) !IF "$(DLLBUILD)" == "1" TARGET_LIB = dll PLUGIN_TARGET = plugin_dir !ELSE TARGET_LIB = staticlib !ENDIF DEFAULT_TARGETS = default: $(TARGET_LIB) $(PLUGIN_TARGET) apps_dir # Batch commands to clean main build output are stored in a macro so they can be reused by different # targets in an inline temporary batch file. # # We want them to run before creating a DLL or static LIB file, but if they were in a target then # that target would have to be a dependency of dll or staticlib and would always have to run, making # the dependent targets "out-of-date". # # We don't want to re-link the whole DLL just because we tried to delete a static LIB that didn't # exist. We also don't want to install a stale DLL in a static build, so we'll remove main build # output before creating main build output, but not as a target dependency. CLEAN_MAIN_BUILD_OUTPUT_CMDS = \ @SETLOCAL EnableExtensions^ if exist gdal.lib del gdal.lib^ if exist $(GDAL_DLL) del $(GDAL_DLL)^ if exist $(GDAL_DLL).manifest del $(GDAL_DLL).manifest^ if exist gdal_i.lib del gdal_i.*^ if exist *.ilk del *.ilk staticlib: $(LIB_DEPENDS) call <