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.11 1996/08/05 07:08:53 tamches
9 # used BACKUP_CORE to remove a /p/paradyn dependency in VPATH
11 # Revision 1.10 1996/04/29 03:27:55 tamches
12 # added APP_PURE_OPTIONS for application-specific purify options
14 # Revision 1.9 1996/01/05 19:52:09 tamches
17 # Revision 1.8 1995/11/29 00:14:12 tamches
18 # added -cache-dir=/tmp option to purify so we don't run out of disk space
19 # while purify works. Added quantify; added qpt.
21 # Revision 1.7 1995/08/29 20:18:17 krisna
22 # removed the "tmp" directory references
23 # changed "cp" BACK TO "mv" for yacc output
25 # Revision 1.6 1995/08/24 15:00:55 hollings
26 # AIX/SP-2 port (including option for split instruction/data heaps)
27 # Tracing of rexec (correctly spawns a paradynd if needed)
28 # Added rtinst function to read getrusage stats (can now be used in metrics)
30 # Improved Error reporting in MDL sematic checks
31 # Fixed MDL Function call statement
32 # Fixed bugs in TK usage (strings passed where UID expected)
34 # Revision 1.5 1995/03/15 19:12:13 jcargill
35 # Added real pure rule, and fixed LDFLAGS
37 # Revision 1.4 1995/02/27 17:37:06 jcargill
38 # Added support for suppressing implicit dependency generation
39 # (EXPLICIT_DEPENDS) and removed PD_NO_DEPENDS support
41 # Revision 1.3 1995/02/16 07:56:46 markc
42 # Added flag to prevent generation of DEPENDS file if PD_NO_DEPENDS is true
43 # to save time during recompiles.
45 # Revision 1.2 1995/01/30 21:26:15 jcargill
46 # Better use of TO_CORE for modules below top-level (e.g. visiClients)
48 # Revision 1.1 1995/01/30 18:08:21 jcargill
49 # Major build system reorganization
53 OBJS = $(patsubst %.C, %.o, $(filter %.C,$(notdir $(SRCS)))) \
54 $(patsubst %.c, %.o, $(filter %.c,$(notdir $(SRCS)))) \
55 $(patsubst %.y, %.o, $(filter %.y,$(notdir $(SRCS)))) \
56 $(patsubst %.l, %.o, $(filter %.l,$(notdir $(SRCS)))) \
57 $(patsubst %.s, %.o, $(filter %.s,$(notdir $(SRCS)))) \
58 $(patsubst %.S, %.o, $(filter %.S,$(notdir $(SRCS)))) \
59 $(IGEN_GEN_SRCS:%.C=%.o)
62 $(TARGET): $(OBJS) $(LIBS)
63 $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
67 # The user may set APP_PURE_OPTIONS for application-specific purify options
69 purify $(APP_PURE_OPTIONS) -cache-dir=/tmp -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
73 quantify: $(OBJS) $(LIBS)
74 quantify -cache-dir=/tmp -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
79 $(MODCC) -static -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
80 # qpt's quick profiling may produce incorrect results in programs
81 # executing interprocedural jumps; this includes setjmp/longjmp.
82 # Hence we must use the -s option for paradyn:
87 DEST = $(TO_CORE)/../bin/$(PLATFORM)
90 #VPATH += ../src:$(TO_CORE)/../lib/$(PLATFORM):/p/paradyn/lib/$(PLATFORM)
91 VPATH += ../src:$(TO_CORE)/../lib/$(PLATFORM):$(BACKUP_CORE)/../lib/$(PLATFORM)
98 rm -f *.o *.[hC] $(TARGET)
100 install: $(DEST)/$(TARGET)
102 $(DEST)/$(TARGET): $(TARGET)
111 # Define DEPENDS dependencies such that the DEPENDS files depends on
112 # the .I files, not the .[Ch] files; otherwise, DEPENDS get rebuilt
113 # all the time. We do need to build the Igen-generated files before
114 # updating DEPENDS, however,
117 ifdef EXPLICIT_DEPENDS
120 DEPENDS: $(SRCS) $(IGEN_ISRCS)
123 $(MAKE) $(IGEN_GEN_SRCS)
125 $(MODCC) -MM $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
126 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
128 ifdef EXPLICIT_DEPENDS
135 $(MODCC) -MM $(MODCFLAGS) $(SRCS) > DEPENDS
136 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
141 # A few pattern rules for simplicity. The default lex rule is
142 # redefined, just for the sake of cleanliness. More important are the
143 # igen rules; they "automatically" pick the correct type of igen to
144 # run. Actually, we can't do this completely "right" unless igen is
145 # changed to generate different output files for the various type of
154 $(LEX) -t $(LFLAGS) $< > $@
156 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
157 $(IGEN) -xdr $(ICFLAGS) $<
159 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
160 $(IGEN) -thread $(ICFLAGS) $<
163 # include the dependencies.