# Makefile for CSU Computer Graphics Classes, GUI # # This Makefile requires the GNU version of `make', located on CS # dept. computer systems in /usr/local/bin/make and /usr/local/bin/gmake # # Places where you'll need to make changes are commented below. # # To determine if you're using the GNU version, type `make -v'. # GNU make will print something similar to the following: # GNU Make version 3.70, by Richard Stallman and Roland McGrath. # Copyright (C) 1988, 89, 90, 91, 92, 93 Free Software Foundation, Inc. # Other verions of make will print something different or an error message. # If 'make' is not GNU make, try 'gmake'. # $Log: Makefile,v $ # Revision 1.2 1994/01/26 20:58:20 goss # CS510 Spring94 Initial released version # # Revision 1.1 1994/01/24 21:55:23 goss # Initial revision # # # Optimization and debug flag: set to -g for debug, -O for optimize OD = -g # Get the name of the operating system we are executing under OSNAME := $(shell uname) # Figure out the name of the ANSI-C compiler, and define appropriate include # directories. CC is the compiler name, CFLAGS contains the proper # compiler options, and LIBS contains the list of libraries and library # directories. ifeq ($(OSNAME),HP-UX) # HP400 or HP700 CC = cc -Aa CFLAGS = $(OD) -I/usr/include/Motif1.2 -I/usr/include/X11R5 -D_HPUX_SOURCE LIBS = -L/usr/lib/Motif1.2 -L/usr/lib/X11R5 -lXm -lXt -lX11 -lm else ifeq ($(OSNAME),AIX) # IBM RS/6000 CC = cc CFLAGS = $(OD) LIBS = -lXm -lXt -lX11 -lm else # Others #HOSTNAME := $(shell hostname) ifeq ($(OSTYPE),solaris) CC = gcc CFLAGS = $(OD) LIBS = -lXm -lXt -lX11 -lm -lsocket -lgen else ifeq ($(OSNAME),Linux) CC = gcc CFLAGS = $(OD) -I/usr/X11R6/LessTif/Motif1.2/include LIBS = -L/usr/X11R6/LessTif/Motif1.2/lib -L/usr/X11R6/lib -lXm -lXt -lX11 -lm #else #ifeq ($(HOSTNAME),eno) # CC = gcc # CFLAGS = $(OD) # LIBS = -lXm -lXt -lX11 -lm -lsocket -lgen #else #ifeq ($(HOSTNAME),eno) # CC = gcc # CFLAGS = $(OD) # LIBS = -lXm -lXt -lX11 -lm -lsocket -lgen else CC = gcc CFLAGS = $(OD) LIBS = -lXm -lXt -lX11 -lm #endif endif endif endif endif ############################################################################## # Change TARGETS to the list of programs to be built (for example, lab1) TARGETS = lab-example # The first rule in the file defines the default list of things to build default: $(TARGETS) # Substitute your program (for example, lab1) for lab-example (see below) lab4: lab4.o xparms.o $(CC) -o $@ $^ $(LIBS) lab4.o: lab4.c xparms.h lab3: lab3.o xparms.o $(CC) -o $@ $^ $(LIBS) lab3.o: lab3.c xparms.h lab2: lab2.o xparms.o $(CC) -o $@ $^ $(LIBS) lab2.o: lab2.c xparms.h lab1: lab1.o xparms.o $(CC) -o $@ $^ $(LIBS) lab1.o: lab1.c xparms.h simple-x: simple-x.o $(CC) -o $@ $^ $(LIBS) simple-x.o: simple-x.c lab-example: lab-example.o xparms.o $(CC) -o $@ $^ $(LIBS) lab-example.o: lab-example.c xparms.h # You probably won't need to change anything after here xparms.o: xparms.c xparms.h # `make clean' will delete all the .o files and the target files clean: rm -f *.o $(TARGETS)