CC=gcc
CFLAGS = 
INCLUDE =  -I OMCv1.3c/src -I include
OMLIBDIR = OMCv1.3c/src


targets: default

# this target creates a bin-directory
bindir:
	if test ! -d bin;  then mkdir bin;  fi
	if test ! -d bin/@GAPARCH@;  then mkdir bin/@GAPARCH@;  fi


gpipe: bindir gpipe.o
	$(CC) -o bin/@GAPARCH@/gpipe  bin/@GAPARCH@/gpipe.o    -L$(OMLIBDIR) -lOM -lm -g


gpipe.o: bindir src/gpipe.c include/gap_tokens.h
	$(CC) -c -o bin/@GAPARCH@/gpipe.o src/gpipe.c $(INCLUDE) $(CFLAGS)

clean:
	rm bin/@GAPARCH@/*.o bin/@GAPARCH@/gpipe

default: bindir gpipe


