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