CC = gcc
-CCFLAGS = -Wall
-BINDIR = ~/.bin
+CCFLAGS = -Wall -O3
+BINDIR = /usr/local/bin
+
+all: anaglyph
+
+${BINDIR}:
+ echo -e "\n\n====\n The specified executable directory (${BINDIR}) does not exist.\n Please adjust the BINDIR variable in the Makefile.\n Alternatively create the directory and make sure it is in the users executable path (\$$PATH)"
+ exit 1
anaglyph: anaglyph.c
${CC} ${CCFLAGS} -oanaglyph anaglyph.c
-install: anaglyph stereofy.sh
- cp anaglyph ${BINDIR}
+install: ${BINDIR} anaglyph stereofy.sh
+ cp anaglyph ${BINDIR}/anaglyph
+ chmod a+x ${BINDIR}/anaglyph
cp stereofy.sh ${BINDIR}/stereofy
+ chmod a+rx ${BINDIR}/stereofy
clean:
rm anaglyph