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.13 1998/04/01 02:59:51 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
41 purify $(APP_PURE_OPTIONS) -cache-dir=/tmp -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
45 quantify: $(OBJS) $(LIBS)
46 quantify -cache-dir=/tmp -$(MODCC) -collector=$(COLLECTOR) $(MODCC) -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS)
51 $(MODCC) -Xlinker -Bstatic -o $(TARGET) $(LDFLAGS) $(OBJS) $(LIBDIR) $(LIBS) $(SYSLIBS) -Xlinker -Bdynamic -ldl -Xlinker -Bstatic -lintl
52 # qpt's quick profiling may produce incorrect results in programs
53 # executing interprocedural jumps; this includes setjmp/longjmp.
54 # Hence we must use the -s option for paradyn:
55 /unsup/qpt2/bin/qpt2 -s $(TARGET)
58 VPATH += ../src:$(TO_CORE)/$(LIBRARY_DEST):$(TO_CORE)/../lib/$(PLATFORM):$(BACKUP_CORE)/../lib/$(PLATFORM)
65 $(RM) *.o *.[hC] $(TARGET) $(TARGETS)
67 ifndef UNCOMMON_INSTALL
68 install: $(DEST)/$(TARGET)
70 $(DEST)/$(TARGET): $(TARGET)
80 # Define DEPENDS dependencies such that the DEPENDS files depends on
81 # the .I files, not the .[Ch] files; otherwise, DEPENDS get rebuilt
82 # all the time. We do need to build the Igen-generated files before
83 # updating DEPENDS, however,
86 ifdef EXPLICIT_DEPENDS
89 DEPENDS: $(SRCS) $(IGEN_ISRCS)
92 $(MAKE) $(IGEN_GEN_SRCS)
94 $(MODCC) -MM $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
95 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
97 ifdef EXPLICIT_DEPENDS
104 $(MODCC) -MM $(MODCFLAGS) $(SRCS) > DEPENDS
105 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
110 # A few pattern rules for simplicity. The default lex rule is
111 # redefined, just for the sake of cleanliness. More important are the
112 # igen rules; they "automatically" pick the correct type of igen to
113 # run. Actually, we can't do this completely "right" unless igen is
114 # changed to generate different output files for the various type of
123 $(LEX) -t $(LFLAGS) $< > $@
125 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
126 $(IGEN) -xdr $(ICFLAGS) $<
128 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
129 $(IGEN) -thread $(ICFLAGS) $<
132 # include the dependencies.