- Implemented fork support for x86-Linux, fixed fork support on
[dyninst.git] / nmake.library.tmpl
1 #
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.
6
7 # $Id: nmake.library.tmpl,v 1.4 1998/07/23 16:22:46 wylie Exp $
8 #
9
10 BUILD_ID= -s $(SUITE_NAME) -v $(RELEASE_NUM)$(BUILD_MARK)$(BUILD_NUM)
11
12 XTARGET = $(TARGET:.lib=)
13 XTARGET = $(XTARGET:.dll=)
14 VOUCHER = V_$(XTARGET)
15
16 $(VOUCHER):
17         @echo Updating build voucher information: $(VOUCHER)
18         $(BUILDSTAMP) $(BUILD_ID) $(XTARGET)
19         $(CC) -c $(VOUCHER).c
20
21 VPATH           = $(VPATH) ../src
22
23 !ifndef UNCOMMON_LINK
24 $(TARGET): $(OBJS)
25         @$(RM) $(TARGET)
26         @$(MAKE) $(VOUCHER)
27         lib -out:$*.lib $(VOUCHER).obj $(OBJS)
28 #       $(RANLIB) $(TARGET)
29
30 !ifdef TARGET2
31 $(TARGET2): $(OBJS2)
32         @$(RM) $(TARGET2)
33         @$(MAKE) $(VOUCHER)
34         $(AR) crv $(TARGET2) $(VOUCHER).obj $(OBJS2)
35         $(RANLIB) $(TARGET2)
36 !endif  # TARGET2
37 !endif  # UNCOMMON_LINK
38
39 !ifndef DEST
40 DEST            = $(TO_CORE)\$(LIBRARY_DEST)
41 !endif
42
43 echo:
44         echo $(OBJS)
45
46 clean:
47         $(RM) *.obj *.h *.C *.lib *.exp *.pdb $(TARGET)
48
49 !ifndef UNCOMMON_INSTALL
50 install: $(DEST)/$(TARGET)
51
52 $(DEST)/$(TARGET):  $(TARGET)
53         $(CP) $(TARGET) $(DEST)
54 #       $(RANLIB) $(DEST)/$(TARGET)
55
56 #
57 # definition for secondary library
58 #
59 !ifdef TARGET2
60 install: $(DEST)/$(TARGET2)
61
62 $(DEST)/$(TARGET2):  $(TARGET2)
63         $(CP) $(TARGET2) $(DEST)
64         $(RANLIB) $(DEST)/$(TARGET2)
65 !endif
66 !endif      # ifndef UNCOMMON_INSTALL
67
68 #
69 # dependency generation definitions
70 #
71
72 #.PHONY : depend
73 #depend:
74 #       $(RM) DEPENDS
75 #       $(MAKE) DEPENDS
76
77
78 # Define DEPENDS dependencies such that the DEPENDS files depends on
79 # the .I files, not the .[Ch] files; otherwise, DEPENDS get rebuilt
80 # all the time.  We do need to build the Igen-generated files before
81 # updating DEPENDS, however,
82 #
83 #!ifdef IGEN_ISRCS
84 #!ifdef EXPLICIT_DEPENDS
85 #DEPENDS:
86 #!else
87 #DEPENDS: $(SRCS) $(IGEN_ISRCS)
88 #!endif
89 #       touch DEPENDS
90 #       $(MAKE) $(IGEN_GEN_SRCS)
91 #       $(MAKE) $(SRCS)
92 #       $(MODCC) -MM $(MODCFLAGS) $(SRCS) $(IGEN_GEN_SRCS) > DEPENDS
93 ##       makedepend -fDEPENDS -- $(CFLAGS) $(SRCS) $(IGEN_SRCS) $(NOPED_SRCS)
94 #!else
95 #!ifdef EXPLICIT_DEPENDS
96 #DEPENDS:
97 #!else
98 #DEPENDS: $(SRCS)
99 #!endif
100 #       touch DEPENDS
101 #       $(MAKE) $(SRCS)
102 #       $(MODCC) -MM $(MODCFLAGS) $(SRCS) > DEPENDS
103 ##       makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
104 #!endif
105
106
107 #.depend.% %.C:
108 #       makedepend -fDEPENDS -- $(CFLAGS) $(SRCS)
109
110 pure:
111
112
113
114 #
115 # A few pattern rules for simplicity in handling igen-generated files.
116 #
117
118 %.xdr.C %.xdr.CLNT.C %.xdr.CLNT.h %.xdr.SRVR.C %.xdr.SRVR.h %.xdr.h: %.I
119         $(IGEN) -xdr $(ICFLAGS) $<
120
121 %.thread.C %.thread.CLNT.h %.thread.SRVR.h %.thread.h: %.I
122         $(IGEN) -thread $(ICFLAGS) $<
123
124
125 {..\src\}.C.obj:
126         $(CXX) $(CXXFLAGS) -c $<
127
128 .C.obj:
129         $(CXX) $(CXXFLAGS) -c $<
130
131 {..\src\}.y.C:
132         $(YACC) $(YFLAGS) $<
133         $(RM) $@
134         $(MV) y.tab.c $@
135
136 {..\src\}.y.obj:
137         $(YACC) $(YFLAGS) $<
138         $(RM) $@
139         $(MV) y.tab.c $@
140         $(CXX) $(CXXFLAGS) -c $<
141
142
143
144 #
145 # include the dependencies.
146 #
147 !include DEPENDS
148