objects = approxcurve asymmetric-curve basics bloat bloat-inside-out bloat-self-intersection combine complement \
          crosshatch curve curved-path ellipse endcaps exor finite-sheet fixed-symmetric-curve hole-in-infinite-sheet \
          hole-intersection holes intersection isolation knickebein linecut linesplit bloat-linesplit lineunion bloat-lineunion nested pcb-broken-curves \
          pcb-top polycurve polycurve2 polygons poly+line-intersection poly+lines2 poly+lines poly+line-union regular_polygons \
          reflect reposition rotate rounded-nested roundtris scale shear shrink shrinkfill square-circle square_curved \
          standalone-hole subtraction-A-B subtraction-B-A symmetric-curve union overlap

# doesn't seem to work (even when explicitly invoked as gmake).  The ecce part does work.
# objects=$(shell ls -1 *.c | ecce - - -command "(r0 v-/.c/s// m,m)0; m-0 (ji/ /)0r0b; m-0nm0ah; %c" > /dev/null 2> /dev/null)

CFLAGS=-g -Wall

all: $(objects)
	echo All up to date

$(objects): %: %.c ../polygon.o ../polygon-dev.o ../polygon-geos.o
	cc -o $@ ${CFLAGS} `geos-config --cflags` -I.. $@.c ../polygon.o ../polygon-dev.o ../polygon-geos.o `geos-config --clibs`  -lglut -lGL -lm

../polygon.o: ../polygon.c ../polygon.h ../polygon-dev.c ../polygon-dev.h
	cc -c -o ../polygon.o ${CFLAGS} `geos-config --cflags` -I.. ../polygon.c

../polygon-dev.o: ../polygon-dev.c ../polygon-dev.h ../polygon.h
	cc -c -o ../polygon-dev.o ${CFLAGS} `geos-config --cflags` -I.. ../polygon-dev.c

../polygon-geos.o: ../polygon-geos.c ../polygon-geos.h ../polygon.h
	cc -c -o ../polygon-geos.o ${CFLAGS} `geos-config --cflags` -I.. ../polygon-geos.c

clean:
	rm -f $(objects)  *.o *~
