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.18 1999/08/09 05:36:15 csserra 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)
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)
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,
96 ifdef EXPLICIT_DEPENDS
99 DEPENDS: $(SRCS) $(IGEN_ISRCS)
102 $(MAKE) $(IGEN_GEN_SRCS)
104 $(MODCC) $(DEPENDFLAGS) $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
105 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
107 ifdef EXPLICIT_DEPENDS
114 $(MODCC) $(DEPENDFLAGS) $(MODCFLAGS) $(SRCS) > DEPENDS
115 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
120 # A few pattern rules for simplicity. The default lex rule is
121 # redefined, just for the sake of cleanliness. More important are the
122 # igen rules; they "automatically" pick the correct type of igen to
123 # run. Actually, we can't do this completely "right" unless igen is
124 # changed to generate different output files for the various type of
133 $(LEX) -t $(LFLAGS) $< > $@
135 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
136 $(IGEN) -xdr $(ICFLAGS) $<
138 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
139 $(IGEN) -thread $(ICFLAGS) $<
142 # include the dependencies.
146 # platform-specific options
147 include $(TO_CORE)/make.platform.tmpl