2 # This file defines the things that should be common to all "programs"
3 # in the paradyn build tree. It depends on things like SRCS and
4 # TARGET being set correctly in the module-specific template and the
5 # architecture-specific Makefile.
7 # $Log: make.program.tmpl,v $
8 # Revision 1.7 1995/08/29 20:18:17 krisna
9 # removed the "tmp" directory references
10 # changed "cp" BACK TO "mv" for yacc output
12 # Revision 1.6 1995/08/24 15:00:55 hollings
13 # AIX/SP-2 port (including option for split instruction/data heaps)
14 # Tracing of rexec (correctly spawns a paradynd if needed)
15 # Added rtinst function to read getrusage stats (can now be used in metrics)
17 # Improved Error reporting in MDL sematic checks
18 # Fixed MDL Function call statement
19 # Fixed bugs in TK usage (strings passed where UID expected)
21 # Revision 1.5 1995/03/15 19:12:13 jcargill
22 # Added real pure rule, and fixed LDFLAGS
24 # Revision 1.4 1995/02/27 17:37:06 jcargill
25 # Added support for suppressing implicit dependency generation
26 # (EXPLICIT_DEPENDS) and removed PD_NO_DEPENDS support
28 # Revision 1.3 1995/02/16 07:56:46 markc
29 # Added flag to prevent generation of DEPENDS file if PD_NO_DEPENDS is true
30 # to save time during recompiles.
32 # Revision 1.2 1995/01/30 21:26:15 jcargill
33 # Better use of TO_CORE for modules below top-level (e.g. visiClients)
35 # Revision 1.1 1995/01/30 18:08:21 jcargill
36 # Major build system reorganization
40 OBJS = $(patsubst %.C, %.o, $(filter %.C,$(notdir $(SRCS)))) \
41 $(patsubst %.c, %.o, $(filter %.c,$(notdir $(SRCS)))) \
42 $(patsubst %.y, %.o, $(filter %.y,$(notdir $(SRCS)))) \
43 $(patsubst %.l, %.o, $(filter %.l,$(notdir $(SRCS)))) \
44 $(patsubst %.s, %.o, $(filter %.s,$(notdir $(SRCS)))) \
45 $(patsubst %.S, %.o, $(filter %.S,$(notdir $(SRCS)))) \
46 $(IGEN_GEN_SRCS:%.C=%.o)
49 $(TARGET): $(OBJS) $(LIBS)
50 $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
55 purify -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
60 DEST = $(TO_CORE)/../bin/$(PLATFORM)
63 VPATH += ../src:$(TO_CORE)/../lib/$(PLATFORM):/p/paradyn/lib/$(PLATFORM)
70 rm -f *.o *.[hC] $(TARGET)
72 install: $(DEST)/$(TARGET)
74 $(DEST)/$(TARGET): $(TARGET)
83 # Define DEPENDS dependencies such that the DEPENDS files depends on
84 # the .I files, not the .[Ch] files; otherwise, DEPENDS get rebuilt
85 # all the time. We do need to build the Igen-generated files before
86 # updating DEPENDS, however,
89 ifdef EXPLICIT_DEPENDS
92 DEPENDS: $(SRCS) $(IGEN_ISRCS)
95 $(MAKE) $(IGEN_GEN_SRCS)
97 $(MODCC) -MM $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
98 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
100 ifdef EXPLICIT_DEPENDS
107 $(MODCC) -MM $(MODCFLAGS) $(SRCS) > DEPENDS
108 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
113 # A few pattern rules for simplicity. The default lex rule is
114 # redefined, just for the sake of cleanliness. More important are the
115 # igen rules; they "automatically" pick the correct type of igen to
116 # run. Actually, we can't do this completely "right" unless igen is
117 # changed to generate different output files for the various type of
126 $(LEX) -t $(LFLAGS) $< > $@
128 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
129 igen -xdr $(ICFLAGS) $<
131 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
132 igen -thread $(ICFLAGS) $<
135 # include the dependencies.