
PREFIX=$(HOME)


BIN=$(PREFIX)/bin
SRC=src


SDF2OGRGDIR=$(PREFIX)/sdf2ogr

CFLAGS += -O2 -Wall 
# CFLAGS += -DDEBUG
#CFLAGS += -DENDMARK

CC=gcc
INSTALL=install
RM=rm -f

all: sdf_ogr.o sdf_read.o
	$(CC) -o sdf2ogr sdf_ogr.o sdf_read.o $(LDFLAGS)  `gdal-config --libs` `gdal-config --cflags`

sdf_ogr.o: $(SRC)/sdf_ogr.c $(SRC)/sdf_ogr.h
	$(CC) $(CFLAGS) -c $(SRC)/sdf_ogr.c  

sdf_read.o: $(SRC)/sdf_read.c $(SRC)/sdf_ogr.h
	$(CC) $(CFLAGS) -c $(SRC)/sdf_read.c

clean:
	$(RM) *.o sdf2ogr core

install: all
	$(INSTALL) -d $(BIN)
	$(INSTALL) -d $(SDF2OGRGDIR)
	$(INSTALL) -m 755 ./sdf2ogr $(BIN)


