# CSCI-1200 Computer Science, Fall 2007 # Simple Makefile for Homework 9 Image Viewer # for g++ on unix or cygwin platforms SHELL = /bin/bash # =============================================================== default: @echo "Please specify a target (unix, cygwin_lib, cygwin_a, or cygwin_x)" # Linux or FreeBSD unix: CC = g++ -g -O3 -Wall -pedantic unix: INCLUDE_PATH = -I/usr/X11R6/include -L/usr/local/include unix: LIB_PATH = -L/usr/X11R6/lib -L/usr/local/lib unix: LIBS = -lm -lGL -lglut unix: all # Cygwin with native Windows libraries, using .lib files from vstudio and glut download cygwin_lib: VCLIB_PATH = /c/PROGRA~1/VSNET.2K3/Vc7/PlatformSDK/Lib cygwin_lib: GLUTLIB_PATH = /c/GLUT cygwin_lib: CC = g++ -g -O3 -Wall -pedantic cygwin_lib: INCLUDE_PATH = -I/usr/include/w32api cygwin_lib: LIB_PATH = -L/usr/lib/w32api cygwin_lib: LIBS = -lm ${VCLIB_PATH}/OPENGL32.LIB ${GLUTLIB_PATH}/glut32.lib cygwin_lib: all # Cygwin with native Windows libraries cygwin_a: CC = g++ -g -O3 -Wall -pedantic cygwin_a: INCLUDE_PATH = -I/usr/include/w32api cygwin_a: LIB_PATH = -L/usr/lib/w32api cygwin_a: LIBS = -lm -lopengl32 -lglut32 cygwin_a: all # Cygwin with X (probably software emulation) cygwin_x: CC = g++ -g -O3 -Wall -pedantic cygwin_x: INCLUDE_PATH = -I/usr/X11R6/include cygwin_x: LIB_PATH = -L/usr/X11R6/lib cygwin_x: LIBS = -lm -lGL -lglut cygwin_x: all # =============================================================== SRCS = image_viewer.cpp image.cpp OBJS = $(SRCS:.cpp=.o) EXE = ImageViewer # =============================================================== # targets .PHONY: all depend clean all: clean depend $(EXE) depend: $(CC) $(INCLUDE_PATH) -E -M $(SRCS) > Makefile.depend clean: rm -f *~ *bak *.ob *.o $(EXE) Makefile.depend # =============================================================== # compilation rules $(EXE): $(OBJS) $(CC) $(INCLUDE_PATH) -o $@ $(OBJS) $(LIB_PATH) $(LIBS) .cpp.o: $(CC) $(INCLUDE_PATH) $< -c -o $@ # =============================================================== -include Makefile.depend