PROG = pldarksky CC = gcc CFLAGS=-Wall -O3 -fopenmp -msse2 -mfpmath=sse -Wl,-rpath,'$$ORIGIN/' -I/usr/include/gdal LIBFLAGS = -lgdal -lezgdal -largtable3 -lm COMMON_C = $(shell ls *.c) COMMON_C_O = $(COMMON_C:%.c=%.o) HEADERS = $(shell ls *.h) ifndef PREFIX PREFIX = /usr/local endif default: $(PROG) $(PROG): $(COMMON_C_O) $(HEADERS) $(CC) $(CFLAGS) -o $(PROG) $(COMMON_O) $(COMMON_C_O) $(LIBFLAGS) $(COMMON_C_O): $(COMMON_C) $(HEADERS_C) $(CC) $(CFLAGS) -c $(COMMON_C) $(LIBFLAGS) install: cp -f $(PROG) $(PREFIX)/bin clean: rm -f *.o $(PROG)