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 # $Id: make.program.tmpl,v 1.16 1999/05/21 17:35:41 wylie Exp $
10 BUILD_ID= -s $(SUITE_NAME) -v $(RELEASE_NUM)$(BUILD_MARK)$(BUILD_NUM)
13 DEST = $(TO_CORE)/$(PROGRAM_DEST)
19 @echo Updating build voucher information: $(VOUCHER)
20 $(BUILDSTAMP) $(BUILD_ID) $(TARGET)
21 $(MODCC) -c $(VOUCHER).c
24 OBJS = $(patsubst %.C, %.o, $(filter %.C,$(notdir $(SRCS)))) \
25 $(patsubst %.c, %.o, $(filter %.c,$(notdir $(SRCS)))) \
26 $(patsubst %.y, %.o, $(filter %.y,$(notdir $(SRCS)))) \
27 $(patsubst %.l, %.o, $(filter %.l,$(notdir $(SRCS)))) \
28 $(patsubst %.s, %.o, $(filter %.s,$(notdir $(SRCS)))) \
29 $(patsubst %.S, %.o, $(filter %.S,$(notdir $(SRCS)))) \
30 $(IGEN_GEN_SRCS:%.C=%.o)
33 $(TARGET): $(OBJS) $(LIBS)
35 $(MODCC) -o $(TARGET) $(LDFLAGS) $(VOUCHER).o $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
39 # The user may set APP_PURE_OPTIONS for application-specific purify options
42 purify $(APP_PURE_OPTIONS) -cache-dir=/tmp \
43 -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) \
44 $(LDFLAGS) $(VOUCHER).o $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
48 quantify: $(OBJS) $(LIBS)
50 quantify -cache-dir=/tmp \
51 -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) \
52 $(LDFLAGS) $(VOUCHER).o $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
58 $(MODCC) -Xlinker -Bstatic -o $(TARGET) \
59 $(LDFLAGS) $(VOUCHER).o $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS) \
60 -Xlinker -Bdynamic -ldl -Xlinker -Bstatic -lintl
61 # qpt's quick profiling may produce incorrect results in programs
62 # executing interprocedural jumps; this includes setjmp/longjmp.
63 # Hence we must use the -s option for paradyn:
64 /unsup/qpt2/bin/qpt2 -s $(TARGET)
67 VPATH += ../src:$(TO_CORE)/$(LIBRARY_DEST):$(TO_CORE)/../lib/$(PLATFORM):$(BACKUP_CORE)/../lib/$(PLATFORM)
74 $(RM) *.o *.[hC] $(TARGET) $(TARGETS)
76 ifndef UNCOMMON_INSTALL
77 install: $(DEST)/$(TARGET)
79 $(DEST)/$(TARGET): $(TARGET)
80 -$(CP) $(TARGET) $(DEST)
89 # Define DEPENDS dependencies such that the DEPENDS files depends on
90 # the .I files, not the .[Ch] files; otherwise, DEPENDS get rebuilt
91 # all the time. We do need to build the Igen-generated files before
92 # updating DEPENDS, however,
95 ifdef EXPLICIT_DEPENDS
98 DEPENDS: $(SRCS) $(IGEN_ISRCS)
101 $(MAKE) $(IGEN_GEN_SRCS)
103 $(MODCC) -MM $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
104 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
106 ifdef EXPLICIT_DEPENDS
113 $(MODCC) -MM $(MODCFLAGS) $(SRCS) > DEPENDS
114 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
119 # A few pattern rules for simplicity. The default lex rule is
120 # redefined, just for the sake of cleanliness. More important are the
121 # igen rules; they "automatically" pick the correct type of igen to
122 # run. Actually, we can't do this completely "right" unless igen is
123 # changed to generate different output files for the various type of
132 $(LEX) -t $(LFLAGS) $< > $@
134 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
135 $(IGEN) -xdr $(ICFLAGS) $<
137 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
138 $(IGEN) -thread $(ICFLAGS) $<
141 # include the dependencies.