prefix = /amd/orange2b/usr/home/home01/taka/OX4L/asir-2018/OpenXM/misc/packages/Linux/Debian2/work/OpenXM
CFLAGS = -g -O2 -I /usr/local/include
LIBS = -L /usr/local/lib -lGLU -lglut
LN_S = ln -s
TARGET = oxmgraph
CC = gcc

INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644

all: ${TARGET}

oxmgraph: graph.c
	${CC} ${CFLAGS} -o $@ graph.c ${LIBS}

install: all
	@if [ ! -z "${TARGET}" ]; then \
		${INSTALL_PROGRAM} oxmgraph ${prefix}/bin ; \
		mkdir -p ${prefix}/share/oxmgraph ; \
		${INSTALL_DATA} share/inobuta.tga ${prefix}/share/oxmgraph ;\
	fi

install-for-debug:
	${LN_S} `pwd`/oxmgraph ${prefix}/bin/oxmgraph

clean:
	rm -rf oxmgraph *.o *~ config.log config.status autom4te.cache

distclean: clean
	rm -f Makefile .configure_done
