/* 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:07 PST 1992 by muller */ /* modified on Tue Sep 22 08:36:14 PDT 1992 by mhb */ /* modified on Mon Jul 6 23:24:49 PDT 1992 by meehan */ /* modified on Fri Apr 3 00:53:20 1992 by steveg */ /* modified on Mon Nov 25 11:23:43 1991 by kalsow */ #undef ultrix #undef vax #undef mips #undef unix #undef aix #undef ps #undef hpux #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 -L$(XLIBPATH) $(XLIB) FORMSVBTLIB = -lm3formsvbt -lm3vbtkit $(UILIB) ZEUSLIB = -lm3mgkit -lm3mg -lm3zeus -lm3codeview $(FORMSVBTLIB) /*--------------------------------------------------------------- imports ---*/ #define source_dir(x) #define package(x) #define SOURCE_DIR FROM_DIR /*--------------------------------------------------------------- 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) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (x.i3, $(PUB_INSTALL), 644)) @@\ 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) @@\ install:: @@\ INSTALL (d, $(PUB_INSTALL), 644)) @@\ 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) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (x.ig, $(PUB_INSTALL), 644)) #define generic_implementation(x) #define Generic_implementation(x) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (x.mg, $(PUB_INSTALL), 644)) #define generic_module(x) @@\ generic_interface(x) @@\ generic_implementation(x) #define Generic_module(x) @@\ Generic_interface(x) @@\ Generic_implementation(x) #define PubExport(name) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (name, $(PUB_INSTALL), 644)) /*------------------------------------------------------ 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) @@\ install:: @@\ INSTALL (lib##name.a, $(LIB_INSTALL), 644) @@\ INSTALL (lib##name.ax, $(LIB_INSTALL), 644) @@\ ranlib $(LIB_INSTALL)/lib##name.a @@\ library(name) #endif #define LibExport(name) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (name, $(LIB_INSTALL), 644)) #define LibdExport(name) @@\ install:: @@\ INSTALL (name, $(LIB_INSTALL), 644) #define LibExportDir(subdir) @@\ install:: @@\ @$(LIB_USE)/recmkdir $(LIB_INSTALL)/subdir @@\ (cd SOURCE_DIR/subdir; \ @@\ for d in *; do \ @@\ INSTALL ($$d, $(LIB_INSTALL)/subdir, 644); \ @@\ done) /*------------------------------------------------------ program building ---*/ #define program(name) @@\ all:: name @@\ clean:: ; rm -f name @@\ name: FRC ; $(DO_M3) -o name $(PGM_SOURCES) $(IMPORT_LIBS) #define Program(name) @@\ install:: @@\ INSTALL (name, $(BIN_INSTALL), 755) @@\ program(name) #define BinExport(name) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (name, $(BIN_INSTALL), 755)) #define BindExport(name) @@\ install:: @@\ INSTALL (name, $(BIN_INSTALL), 755) /*------------------------------------------------------- object building ---*/ #define just_compile @@\ all:: @@\ $(DO_M3) -c $(PGM_SOURCES) /*------------------------------------------------------------- man pages ---*/ #define manPage(name,sec) #define ManPage(name,sec) @@\ manPage(name,sec) @@\ ManExport(name,sec) #if defined (MAN_SECTION) #define ManExport(name,sec) @@\ install:: @@\ (cd SOURCE_DIR; \ @@\ INSTALL (name##.##sec, \ @@\ $(MAN_INSTALL)/man##MAN_SECTION##/##name##.MAN_SECTION, 644)) #define MandExport(name,sec) @@\ install:: @@\ INSTALL (name##.##sec, \ @@\ $(MAN_INSTALL)/man##MAN_SECTION/##name##.MAN_SECTION, 644) #else #define ManExport(name,sec) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (name##.##sec, $(MAN_INSTALL)/man##sec, 644)) #define MandExport(name,sec) @@\ install:: @@\ INSTALL (name##.##sec, $(MAN_INSTALL)/man##sec, 644) #endif /*------------------------------------------------------------ misc files ---*/ #define Gnuemacs(name) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (name.el, $(GNUEMACS_INSTALL), 644)) #define CompiledGnuemacs(name) @@\ install:: @@\ (cd SOURCE_DIR; INSTALL (name.elc, $(GNUEMACS_INSTALL), 644)) @@\ all:: 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 .EXPORTED_BIN .RSRC_CMD rm -f .m3imports* #endif FRC: