CC = gcc #CFLAGS = -g -DGRAY CFLAGS = -g # Home of the installed program DEST = . # System header (/usr/include) files used EXTHDRS = # Header files created for this program HDRS = # Home of header files created for this program INCLUDE = /usr/monash/gnu/include # Flags for use with link-loader; note: these must point to libtkGLX, # and the Tk and Tcl libraries. LDFLAGS = -L/usr/monash/gnu/lib -L/u/hon/acb/lib-sgi # Libraries created for this program LIBS = -ltkGLX -ltk4.0 -ltcl7.4 -lgl -lX11 -lm # Name of link-loader to be used LINKER = $(CC) # Name of this make file MAKEFILE = Makefile # List of object files for this program OBJS = face-tcl.o face-gl.o face_data.o tkAppInit.o # Name of this program's executable file PROGRAM = tkface # List of the source files for this program (except header files) SRCS = face-tcl.c face-gl.c face_data.c tkAppInit.c # Rules .c.o:; $(CC) -c $(CFLAGS) -I$(INCLUDE) $*.c # Target to link object and create executable in current directory $(PROGRAM): $(OBJS) @echo "Linking $(PROGRAM)..." $(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM) @echo "...linking of $(PROGRAM) completed." # Alternative target to link object and create executable in current directory all: $(PROGRAM) # Target to remove non-critical files from directory clean: @rm -f $(OBJS) # Target to provide index of functions in source and header files index: @ctags -wx $(HDRS) $(SRCS) # Target to install the program in its home install: $(PROGRAM) @echo "Installing $(PROGRAM) in $(DEST)..." @install -s $(PROGRAM) $(DEST) @echo "...installation of $(PROGRAM) completed." # Another alternative target to create executable in current directory program: $(PROGRAM) # Target to create "tags" file for ex(1) or vi(1) tags: $(HDRS) $(SRCS) @ctags $(HDRS) $(SRCS) # Target to update installed program update: $(DEST)/$(PROGRAM) # Alternative target to update installed program $(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS) @make -f $(MAKEFILE) DEST=$(DEST) install # Target to reassemble #include dependencies depend: grep '^#[ ]*include' ${SRCS} |\ grep -v '<' | \ sed 's,:[^"]*"\([^"]*\)".*,: $(INCLUDE)/\1,' | \ sed 's/\.c/.o/' | \ awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ else rec = rec " " $$2 } } \ END { print rec } ' > makedep echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep echo '$$r makedep' >>eddep echo 'w' >>eddep cp Makefile Makefile.bak ed - Makefile < eddep rm eddep makedep # DO NOT DELETE THIS LINE - "make depend" relies on it.