CC = gcc
-CCFLAGS = -Wall
+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
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
int error(int code){
char *msg = "Unknown Error\n";
switch (code) {
- case 1: msg = "Usage: anaglyph [ -[fhd]gm | -[fhd]rc | -fmc | -dab ] left.rgb right.rgb output.rgb\n";
- case 2: msg = "Could not open input file for reading\n";
- case 3: msg = "Could not open output file for writing\n";
- case 4: msg = "Unexpected end of file\n";
- case 5: msg = "Cannot write to output file\n";
+ case 1: msg = "Usage: anaglyph [ -[fhd]gm | -[fhd]rc | -fmc | -dab ] left.rgb right.rgb output.rgb\n"; break;
+ case 2: msg = "Could not open input file for reading\n"; break;
+ case 3: msg = "Could not open output file for writing\n"; break;
+ case 4: msg = "Unexpected end of file\n"; break;
+ case 5: msg = "Cannot write to output file\n"; break;
}
- fprintf(stderr, msg); return code;
+ fprintf(stderr, "%s", msg); return code;
}
// min-max to prevent overflowing in Dubois calculations