# # This is a sample Makefile to be used to compile 441 systems that use an # InterViews interface. Comments throughout the file describe what the various # definitions and dependency rules do. # # NOTE: search for the word "your" to see where your changes need to go. # # OBJS defines the .o files to be compiled. OBJ = main.o OBJ2 = main2.o OBJ3 = main3.o OBJ4 = main4.o OBJ5 = main5.o OBJD = dynamic-add-element.o # SRCS defines the .c files that correspond to the OBJS. By convention, this # Makefile and the .o files it builds should be in a platform-specific # directory that is below the source file directory(ies). Hence, SRCS is # defined as ../*.c. (NOTE: In a complete 441 system dirctory, sources will be # subdivied into .h files and .c files, in ../design/*.h and # ../implementation/*.c, respectively.) SRCDIR = .. SRCS = $(SRCDIR)/*.c # CPU defines the platform-specific directory in which this Makefile resides. # For galaxy, the dirctory name is SUN4G (by local convention). CPU = SUN4G # IVDIR is the root of the InterViews library directory. The other defs with # the IV prefix are specific InterViews subdirectories where includes and # exectuables reside. IVDIR = /mnt/thyme/pkg/InterViews/iv-2.6 #IVLIBDIR = $(IVDIR)/installed/lib/$(CPU) IVLIBDIR = $(IVDIR)/src/libInterViews-new/SUN4G-solaris IVLIBS = -lInterViewsX11 -lgraphic #IVLIBSg = -lInterViewsX11-g -lgraphic-g IVLIBSg = -lInterViewsX11-g IVLIBS = -lInterViewsX11-g.a IVSRCDIR = $(IVDIR)/src/new IVSTDLIBDIR = $(IVSRCDIR)/InterViews/Std # XLIB is the X-Windows library that InterViews uses. XLIB = -lX11 # MATHLIB is the UNIX math library. Generally, it needs to be the last # included. MATHLIB = -lm # OHTERLIBS is empty by default. If your system uses other libraries, such as # RogueWave or gdbm, change the definition of OTHERLIBS accordingly. Sample # alternative defs follow as comments. (Remove the comment from the one that # suits your needs.) OTHERLIBS = # Alternative def to use Rogue Wave library. # OTHERLIBS = -lrwtool # Alternative def to use gdbm library. # OTHERLIBS = -lgdbm # Alternative def to use both Rogue Wave and gdbm libraries. # OTHERLIBS = -lgdbm -lrwtool # FISHERDIR is the root of directory under which 441 includes and executables # are located. FISHERDIR = /home/phoenix/faculty/gfisher # 441INCLUDEDIR is the location of 441 include files, See # ~gfisher/441/{include,lib} for further discussion. 441INCLUDEDIR = $(FISHERDIR)/441/include # 441LIBDIR is the location of lib441.a, which contains .o files for 441 # library classes. See ~gfisher/441/{include,lib} for further discussion. 441LIBDIR = $(FISHERDIR)/441/lib/$(CPU) #441LIB = -l441 441LIB = # RWINCLUDEIR is the location of the Rogue Wave library includes. This def is # only needed to work around a bug in the currrent g++. RWINCLUDEDIR = . # OPENWINLIBDIR is the of the Sun OpenWindows lib. It's where the X libs are. OPENWINLIBDIR = /usr/openwin/lib # CFLAGS is the standard make definition for the flags that will be used by the # C++ compiler (g++ here). The -g flag enables debugging; the -I flags extend # the paths where .h files will be searched for; the -L file extends the paths # where .a files will be searched for. The -D flags define required # compilation flags. See "man gcc" for further details. CFLAGS = -g -I$(IVSRCDIR) -I$(IVSTDLIBDIR) -I$(FISHERDIR) \ -I. -I$(RWINCLUDEDIR) \ -L$(441LIBDIR) -L$(IVLIBDIR) \ -L$(OPENWINLIBDIR) \ -DGCC2 -Dc_plusplus -Dgcc_2_6_3 -Dsolaris # LDFLAGS is the standard make defintion for the flags that will be used by C++ # to link all of the objects. LDFLAGS = -ansi -g -L$(IVLIBDIR) -L$(441LIBDIR) # CC defines the compiler CC = g++ # LIBS is the defintion of all the libraries needed to compile. LIBSg uses the # (larger) debuggable InterViews libraries. The debuggable libraries allow gdb # breakpoints and stack traces to be used in library files. # IMPORTANT NOTE: 441LIB must come before OTHERLIBS. LIBS = $(441LIB) $(OTHERLIBS) $(IVLIBS) $(XLIB) $(MATHLIB) -lg++ LIBSg = $(441LIB) $(OTHERLIBS) $(IVLIBSg) $(XLIB) $(MATHLIB) -lg++ # DEPENDDIRS defines the library that makedepend should use. See "man # makedepend" for further discussion of the makedepend utility. DEPENDDIRS = -I$(IVSRCDIR) -I$(IVSTDLIBDIR) -I$(FISHERDIR) \ -I$(441INCLUDEDIR) -I$(RWINCLUDEDIR) \ -I/usr/local/lib -I/usr/local/include/g++-include # # The following rule tells make how to compile automatically compile .c files # into .o files. #.c.o: # $(CC) $(CFLAGS) -c $< # # The following dependency rule is generic. Replace "your-system" with the # name of your executable system (e.g., restaurant, bboard, calendar, grader, # scheduler, testtool). all: main main2 main3 main4 main5 dynadd main: $(OBJ) $(CC) $(CFLAGS) $^ $(LIBSg) -o $@ main2: $(OBJ2) $(CC) $(CFLAGS) $^ $(LIBSg) -o $@ main3: $(OBJ3) $(CC) $(CFLAGS) $^ $(LIBSg) -o $@ main4: $(OBJ4) $(CC) $(CFLAGS) $^ $(LIBSg) -o $@ main5: $(OBJ5) $(CC) $(CFLAGS) $^ $(LIBSg) -o $@ dynadd: $(OBJD) $(CC) $(CFLAGS) $^ $(LIBSg) -o dynadd # # The following is a bit of Makefile hackery that defines how each source file # will be compiled. It is recommended that you use the rule as is. %.o: $(SRCDIR)/%.c $(CC) -c $(CFLAGS) $< # # The following rule defines how makedepend will be run. Run "make depend" # whenever a "#include" is added to any .c file. When "make depend" is run, it # automatically generates low-level dependencies rules below. See "man # makedepend" for further discussion. depend: $(SRCS) makedepend $(DEPENDDIRS) $(SRCS) # # The following rule removes all .o files. clean: /bin/rm -f *.o # # The following rule is used to rename all .c files to .c files in $(SRCDIR). # NOTE: Be sure that $(SRCDIR) is correctly defined above. Cextensions: @csh -c "if (! -e .make-C-extensions) \ cp /home/phoenix/faculty/gfisher/441/examples/.make-C-extensions \ .make-C-extensions" @csh -c "chmod a+x .make-C-extensions" @csh -c ".make-C-extensions $(SRCDIR)" # DO NOT DELETE THIS LINE -- make depend depends on it. dynamic-add-element.o: /usr/include/stdio.h /usr/include/sys/feature_tests.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/button.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/interactor.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/defs.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/subject.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/resource.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/glue.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/shape.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/message.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/tray.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/scene.h dynamic-add-element.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/world.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/message.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/interactor.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/defs.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/tray.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/scene.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/shape.h main.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/world.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/message.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/interactor.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/defs.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/tray.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/scene.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/shape.h main2.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/world.h main3.o: /usr/include/stdio.h /usr/include/sys/feature_tests.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/glue.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/interactor.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/defs.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/shape.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/message.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/tray.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/scene.h main3.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/world.h main4.o: /usr/include/stdio.h /usr/include/sys/feature_tests.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/glue.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/interactor.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/defs.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/shape.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/message.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/tray.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/scene.h main4.o: /mnt/thyme/pkg/InterViews/iv-2.6/src/new/InterViews/world.h