/* Copyright (C) 1992, Digital Equipment Corporation */ /* All rights reserved. */ /* See the file COPYRIGHT for a full description. */ /* Last modified on Mon Dec 21 21:34:34 PST 1992 by muller */ /* modified on Tue Sep 22 08:35:35 PDT 1992 by mhb */ /* modified on Tue Jul 21 23:01:21 1992 by steveg */ /* modified on Mon Jul 6 23:24:48 PDT 1992 by meehan */ /* modified on Fri Mar 6 13:23:52 PST 1992 by kalsow */ #undef vax #undef mips #undef ultrix #undef sparc #include "config" /* 'all' is the default target */ all:: /*------------------------------------------------------------ definitions ---*/ M3 = $(BIN_USE)/m3 /* $(BIN_USE) to go around a bug in Ultrix 4.2 make */ M3FLAGS = -w1 -make -why M3DEFPATH = M3LIBPATH = DO_M3 = $(M3) $(M3FLAGS) $(M3OPT) $(M3OPTIONS) $(M3DEFPATH) $(M3LIBPATH) /* There are some common combinations of libraries */ X11LIBS = -L$(XLIBPATH) -lXaw -lXmu -lXext -lXt $(XLIB) M3X11LIBS = -lm3X11R4 $(X11LIBS) UILIB = -lm3ui -lm3X11R4 $(XLIB) FORMSVBTLIB = -lm3formsvbt -lm3vbtkit $(UILIB) ZEUSLIB = -lm3mgkit -lm3mg -lm3zeus -lm3codeview $(FORMSVBTLIB) /*--------------------------------------------------------------- imports ---*/ #define Pkg(name) PKGROOT/name #if defined (SCRATCH_PKGS) all:: FRC rm -fr .pkgs #endif all:: .pkgs .pkgs:: $(M3MAKEFILE) ;\ @echo "building import links..." ;\ rm -rf .pkgs ;\ mkdir .pkgs ;\ pkgnames="$(PACKAGES)" ;\ for PKG in $$pkgnames; do (\ echo " " $$PKG ;\ $(LIB_USE)/m3mkpath .pkgs/$$PKG ;\ rm -f .pkgs/$$PKG ;\ ln -s Pkg($$PKG) .pkgs/$$PKG \ ); done #define SOURCE_DIR FROM_DIR #define source_dir(x) #define package(x) @@\ PACKAGES += x /*--------------------------------------------------------------- sources ---*/ #define source(x) @@\ /* SOURCES += SOURCE_DIR/##x */ #define pgm_source(x) @@\ source(x) @@\ PGM_SOURCES ++= SOURCE_DIR/##x #define interface(x) @@\ pgm_source(x.i3) #define Interface(x) @@\ EXPORTED_PUB +++= HERE/SOURCE_DIR/##x.i3 @@\ interface(x) #define implementation(x) @@\ pgm_source(x.m3) #define module(x) @@\ interface(x) @@\ implementation(x) #define Module(x) @@\ Interface(x) @@\ implementation(x) #define h_source(x) @@\ pgm_source(x.h) #define c_source(x) @@\ pgm_source(x.c) #define s_source(x) @@\ pgm_source(x.s) #define import_lib(x) @@\ IMPORT_LIBS += -l##x #define import_obj(x) @@\ IMPORT_LIBS += x #define m3_option(x) @@\ M3OPTIONS += x /*----------------------------------------------------------------- noweb ---*/ TANGLEFLAGS = -L'<*LINE %L "%F" *>%N' WEAVEFLAGS = -n #define noweb_doc(f,dir) @@\ doc.dvi:: f.tex @@\ f.tex: dir/f.nw @@\ noweave $(WEAVEFLAGS) dir/f.nw | cpif f.tex @@\ clean:: ; rm -f f.tex #define noweb(f,r,d) @@\ all:: d @@\ d:: SOURCE_DIR/f.nw @@\ notangle $(TANGLEFLAGS) -R##r SOURCE_DIR/f.nw | cpif d @@\ clean:: ; rm -f d @@\ PGM_SOURCES ++= d #define Noweb(f,r,d) @@\ EXPORTED_PUB +++= HERE##d @@\ noweb(f,r,d) /*------------------------------------------------------------------ zume ---*/ #define zume(x) @@\ all:: x##AlgClass.i3 @@\ clean:: FRC @@\ rm -f x##.evt x##AlgClass.i3 x##ViewClass.i3 x##IE.i3 @@\ rm -f x##TranscriptView.i3 x##AlgClass.m3 x##ViewClass.m3 @@\ rm -f x##IE.m3 x##TranscriptView.m3 x##EventData.fv @@\ rm -f x##TranscriptView.fv @@\ x##AlgClass.i3: SOURCE_DIR/x.evt @@\ $(BIN_USE)/m3zume SOURCE_DIR/x @@\ PGM_SOURCES ++= x##AlgClass.i3 @@\ PGM_SOURCES ++= x##ViewClass.i3 @@\ PGM_SOURCES ++= x##IE.i3 @@\ PGM_SOURCES ++= x##TranscriptView.i3 @@\ PGM_SOURCES ++= x##AlgClass.m3 @@\ PGM_SOURCES ++= x##ViewClass.m3 @@\ PGM_SOURCES ++= x##IE.m3 @@\ PGM_SOURCES ++= x##TranscriptView.m3 @@\ RSRC_CMD ++= -element @@\ RSRC_CMD ++= x##EventData.fv @@\ RSRC_CMD ++= x##EventData.fv @@\ RSRC_CMD ++= -element @@\ RSRC_CMD ++= x##TranscriptView.fv @@\ RSRC_CMD ++= x##TranscriptView.fv @@\ .RSRC_MODIFIED:: x##AlgClass.i3 @@\ @touch .RSRC_MODIFIED /*------------------------------------------------------------- resources ---*/ #define resource_named(rd,x) @@\ RSRC_CMD ++= -element @@\ RSRC_CMD ++= rd @@\ RSRC_CMD ++= SOURCE_DIR/x @@\ .RSRC_MODIFIED:: SOURCE_DIR/x @@\ @touch .RSRC_MODIFIED #define resource(x) @@\ resource_named(x,x) #define bundle(m) @@\ all:: m.m3 m.i3 @@\ clean:: FRC @@\ rm -f m.i3 m.m3 .RSRC_MODIFIED @@\ m.i3 m.m3: .RSRC_MODIFIED @@\ $(BIN_USE)/m3bundle -name m $(RSRC_CMD) @@\ PGM_SOURCES ++= m.i3 @@\ PGM_SOURCES ++= m.m3 /*-------------------------------------------------------------- generics ---*/ #define generic_interface(x) #define Generic_interface(x) @@\ EXPORTED_PUB +++= HERE/SOURCE_DIR/##x.ig #define generic_implementation(x) #define Generic_implementation(x) @@\ EXPORTED_PUB +++= HERE/SOURCE_DIR/##x.mg #define generic_module(x) @@\ generic_interface(x) @@\ generic_implementation(x) #define Generic_module(x) @@\ Generic_interface(x) @@\ Generic_implementation(x) #define PubExport(name) @@\ EXPORTED_PUB +++= HERE/SOURCE_DIR/##name /*------------------------------------------------------ library building ---*/ /* The library and Library functions may be defined in the config in the config file to support shared libraries */ #if !defined (library) #define library(name) @@\ all:: lib##name.a @@\ clean:: ; rm -f lib##name.a lib##name.ax @@\ lib##name.a: FRC ; $(DO_M3) -a lib##name.a $(PGM_SOURCES) $(IMPORT_LIBS) #endif #if !defined (Library) #define Library(name) @@\ EXPORTED_LIB +++= HERE/lib##name.a @@\ EXPORTED_LIB +++= HERE/lib##name.ax @@\ library(name) #endif #define LibExport(name) @@\ EXPORTED_LIB +++= HERE/SOURCE_DIR/##name #define LibdExport(name) @@\ EXPORTED_LIB +++= HERE/name #define LibExportDir(subdir) @@\ LibExport(subdir) /*------------------------------------------------------ program building ---*/ #define _pgm_(name,root) @@\ all:: name @@\ clean:: ; rm -f root root.ov root.b root.bx root.by @@\ name: FRC ; $(DO_M3) -o name $(PGM_SOURCES) $(IMPORT_LIBS) #ifdef TIP #define program(name) \ import_obj(name.b) \ _pgm_(name,name) #undef ICEBERG #else #ifdef ICEBERG #define program(name) _pgm_(name.b,name) #undef TIP #else #define program(name) _pgm_(name,name) #define TIP #define ICEBERG #endif #endif #define Program(name) @@\ EXPORTED_BIN +++= HERE/name @@\ program(name) #define BinExport(name) @@\ EXPORTED_BIN +++= HERE/SOURCE_DIR/##name #define BindExport(name) @@\ EXPORTED_BIN +++= HERE/name /*------------------------------------------------------ objects building ---*/ #define just_compile @@\ all:: @@\ $(DO_M3) -c $(PGM_SOURCES) /*------------------------------------------------------------- man pages ---*/ #define manPage(name,sec) @@\ all:: name.sec @@\ clean:: ; rm -f name.sec @@\ name.sec:: SOURCE_DIR/##name##.##sec @@\ catman $? > $@ #define ManPage(name,sec) @@\ manPage(name,sec) @@\ EXPORTED_MAN##sec +++= HERE/##name##.##sec #define ManExport(name,sec) @@\ EXPORTED_MAN##sec +++= HERE/SOURCE_DIR/##name##.##sec #define MandExport(name,sec) @@\ EXPORTED_MAN##sec +++= HERE/##name##.##sec /*------------------------------------------------------------ misc files ---*/ #define Gnuemacs(name) @@\ EXPORTED_GNUEMACS +++= HERE/SOURCE_DIR/##name##.el #define CompiledGnuemacs(name) @@\ EXPORTED_GNUEMACS +++= HERE/SOURCE_DIR/##name##.elc @@\ SOURCE_DIR/##name##.elc: SOURCE_DIR/##name##.el @@\ @echo name##.elc is not up to date /*--------------------------------------------------------- user makefile ---*/ #include INCLUDE_IMAKEFILE /*-------------------------------------------------------------- clean up ---*/ #if !defined (NOCLEAN) scratch:: clean tidy:: find . \( -name ",*" -o -name ".,*" -o -name ".emacs_[0-9]*" \ -o -name "*~" -o -name core -o -name a.out \) -print | xargs rm -f clean:: tidy find . \( -name "*.o" -o -name "*.io" -o -name "*.ix" \ @@\ -o -name "*.mo" -o -name "*.mx" \) -print | xargs rm -f rm -f .makefile .m3path* .PGM_SOURCES .EXPORT* .RSRC_CMD rm -f .m3imports* #endif /*----------------------------------------------------------------- vesta ---*/ checkin:: ; vmake -noeval ; vmake -ci < /dev/null checkout:: ; vmake -co $(PACKAGE) < /dev/null vestacreate:: ; vmake -co $(PACKAGE).1 FRC: