#####Initialize the variables #Using SunOS, HP-UX, or Linux UNAME := $(shell uname) LDFLAGS = CFLAGS = #Location of OpenGL GLHOME = /s/parsons/l/sys/Mesa-3.0 CC = gcc # OPTIMIZE (O6) or DEBUG (ggdb) CGLAGS += -ggdb #CFLAGS + = -O6 ##### Set up Libs and Headers: #Standard Libraries, math libraries etc.. LDFLAGS += -lm #Extra things that certain Machines like to have for X Windows ifeq ($(UNAME),SunOS) LDFLAGS += -L/usr/X11/lib endif ifeq ($(UNAME),HP-UX) CFLAGS += -I/usr/include/X11R4 LDFLAGS += -L/usr/lib/X11R4 -lXext -lXmu endif ifeq ($(UNAME),Linux) CFLAGS += -I/usr/X11/include LDFLAGS += -L/usr/X11/lib -lXext endif #Libraries Required to use X Windows LDFLAGS += -lX11 -lXm -lXt -lXi #Libraries Required to use OpenGL LDFLAGS += -L$(GLHOME)/lib/$(UNAME) -lMesaGL -lMesaGLw -lMesaGLU -lglut #Location of OpenGL Header files CFLAGS += -I$(GLHOME)/include #To make C++ work too CPPFLAGS = $(CFLAGS) ###################################################################### ##### The real stuff: #The Program to compile TARGET = rotatebox #Extra Object Files you might need OBJ_FILES = $(TARGET): $(TARGET).o $(OBJ_FILES) $(CC) $^ -o $@ $(LDFLAGS) clean: rm -f *.o $(TARGET) *~ \#*\# core