2 # This file defines the things that should be common to all "libraries"
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.library.tmpl,v $
8 # Revision 1.11 1997/08/21 18:57:25 naim
9 # Fixing problem when using cc and -MM - naim
11 # Revision 1.10 1997/08/20 22:08:29 naim
12 # Fixing a small error with my previous commit - naim
14 # Revision 1.9 1997/08/19 19:50:21 naim
15 # Adding support to dynamically link libdyninstRT by using dlopen on sparc-
18 # Revision 1.8 1996/11/26 16:02:19 naim
19 # Implementation of cross-compiler (sparc-solaris,x86-solaris)->rs6000 - naim
21 # Revision 1.7 1996/01/05 19:51:52 tamches
24 # Revision 1.6 1995/08/24 15:00:54 hollings
25 # AIX/SP-2 port (including option for split instruction/data heaps)
26 # Tracing of rexec (correctly spawns a paradynd if needed)
27 # Added rtinst function to read getrusage stats (can now be used in metrics)
29 # Improved Error reporting in MDL sematic checks
30 # Fixed MDL Function call statement
31 # Fixed bugs in TK usage (strings passed where UID expected)
33 # Revision 1.5 1995/02/27 17:37:04 jcargill
34 # Added support for suppressing implicit dependency generation
35 # (EXPLICIT_DEPENDS) and removed PD_NO_DEPENDS support
37 # Revision 1.4 1995/02/21 16:34:06 jcargill
38 # Allow module-specific linking and installing where desired
40 # Revision 1.3 1995/02/17 22:19:21 markc
41 # Added defs to build libutilPVM.a
43 # Revision 1.2 1995/01/30 21:26:16 jcargill
44 # Better use of TO_CORE for modules below top-level (e.g. visiClients)
46 # Revision 1.1 1995/01/30 18:08:18 jcargill
47 # Major build system reorganization
54 OBJS = $(patsubst %.C, %.o, $(filter %.C,$(notdir $(SRCS)))) \
55 $(patsubst %.c, %.o, $(filter %.c,$(notdir $(SRCS)))) \
56 $(patsubst %.y, %.o, $(filter %.y,$(notdir $(SRCS)))) \
57 $(patsubst %.l, %.o, $(filter %.l,$(notdir $(SRCS)))) \
58 $(patsubst %.s, %.o, $(filter %.s,$(notdir $(SRCS)))) \
59 $(patsubst %.S, %.o, $(filter %.S,$(notdir $(SRCS)))) \
60 $(IGEN_GEN_SRCS:%.C=%.o)
65 $(AR) crv $(TARGET) $(OBJS)
71 $(AR) crv $(TARGET2) $(OBJS2)
77 DEST = $(TO_CORE)/../lib/$(PLATFORM)
84 rm -f *.o *.[hC] *.a $(TARGET) *.so*
86 ifndef UNCOMMON_INSTALL
87 install: $(DEST)/$(TARGET)
89 $(DEST)/$(TARGET): $(TARGET)
91 $(RANLIB) $(DEST)/$(TARGET)
94 # definition for secondary library
97 install: $(DEST)/$(TARGET2)
99 $(DEST)/$(TARGET2): $(TARGET2)
100 cp $(TARGET2) $(DEST)
101 $(RANLIB) $(DEST)/$(TARGET2)
105 # definition for USES_LIBDYNINSTRT_SO
108 install: $(DEST)/$(TARGET3)
110 $(DEST)/$(TARGET3): $(TARGET3)
111 cp $(TARGET3) $(DEST)
114 endif # ifndef UNCOMMON_INSTALL
117 # dependency generation definitions
126 # Define DEPENDS dependencies such that the DEPENDS files depends on
127 # the .I files, not the .[Ch] files; otherwise, DEPENDS get rebuilt
128 # all the time. We do need to build the Igen-generated files before
129 # updating DEPENDS, however,
132 ifdef EXPLICIT_DEPENDS
135 DEPENDS: $(SRCS) $(IGEN_ISRCS)
138 $(MAKE) $(IGEN_GEN_SRCS)
140 $(MODCC) -MM $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
141 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
143 ifdef EXPLICIT_DEPENDS
151 gcc -MM $(MODCFLAGS) $(SRCS) > DEPENDS
153 $(MODCC) -MM $(MODCFLAGS) $(SRCS) > DEPENDS
155 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
160 # makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
166 # A few pattern rules for simplicity in handling igen-generated files.
169 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
170 $(IGEN) -xdr $(ICFLAGS) $<
172 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
173 $(IGEN) -thread $(ICFLAGS) $<
177 # include the dependencies.