1 | XCOMM ########################################################################## |
---|
2 | XCOMM # SCCS_data: @(#) WcLib.tmpl 1.5 92/06/10 06:09:55 |
---|
3 | XCOMM # |
---|
4 | |
---|
5 | /* |
---|
6 | * Wcl Library Template |
---|
7 | * Uses: LibraryName, and if defined, LibraryOptions and UseTableFromXp |
---|
8 | * USRLIBDIR, INCDIR, SOWCREV, HEADERS, SRCS, OBJS |
---|
9 | */ |
---|
10 | |
---|
11 | LIBRARY_NAME = LibraryName |
---|
12 | INSTALLFLAGS = $(INSTINCFLAGS) |
---|
13 | LINTLIBS = $(LINTXLIB) |
---|
14 | |
---|
15 | #if XRelease >= 50 |
---|
16 | XCOMM # Wcl Library Template for X11R5 |
---|
17 | XCOMM # |
---|
18 | |
---|
19 | LIBRARY_g = $(LIBRARY_NAME)$(DLX) |
---|
20 | LIBRARY_p = $(LIBRARY_NAME)_p |
---|
21 | |
---|
22 | /* LibraryObjectRule which accepts cc options |
---|
23 | */ |
---|
24 | #define CustomLibraryObjectRule(options) @@\ |
---|
25 | all:: @@\ |
---|
26 | _DebuggedLibMkdir() @@\ |
---|
27 | _ProfiledLibMkdir() @@\ |
---|
28 | _SharedLibMkdir() @@\ |
---|
29 | @@\ |
---|
30 | .c.o: @@\ |
---|
31 | _DebuggedObjCompile(options) @@\ |
---|
32 | _ProfiledObjCompile(options) @@\ |
---|
33 | _SharedObjCompile(options) @@\ |
---|
34 | _NormalObjCompile(options) @@\ |
---|
35 | @@\ |
---|
36 | clean:: @@\ |
---|
37 | _DebuggedCleanDir() @@\ |
---|
38 | _ProfiledCleanDir() @@\ |
---|
39 | _SharedCleanDir() @@\ |
---|
40 | |
---|
41 | |
---|
42 | #ifdef LibraryOptions |
---|
43 | DEPENDFLAGS = LibraryOptions |
---|
44 | CustomLibraryObjectRule($(DEPENDFLAGS)) |
---|
45 | #else |
---|
46 | LibraryObjectRule() |
---|
47 | #endif |
---|
48 | |
---|
49 | #if DoSharedLib |
---|
50 | #if DoNormalLib |
---|
51 | SharedLibraryTarget($(LIBRARY_NAME),$(SOWCREV),$(OBJS),shared,..) |
---|
52 | #else |
---|
53 | SharedLibraryTarget($(LIBRARY_NAME),$(SOWCREV),$(OBJS),.,.) |
---|
54 | #endif |
---|
55 | InstallSharedLibrary($(LIBRARY_NAME),$(SOWCREV),$(USRLIBDIR)) |
---|
56 | #endif |
---|
57 | #if DoNormalLib |
---|
58 | NormalLibraryTarget($(LIBRARY_NAME),$(OBJS)) |
---|
59 | InstallLibrary($(LIBRARY_NAME),$(USRLIBDIR)) |
---|
60 | #endif |
---|
61 | #if DoProfileLib |
---|
62 | ProfiledLibraryTarget($(LIBRARY_NAME),$(OBJS)) |
---|
63 | InstallLibrary($(LIBRARY_p),$(USRLIBDIR)) |
---|
64 | #endif |
---|
65 | #if DoDebugLib |
---|
66 | DebuggedLibraryTarget($(LIBRARY_NAME),$(OBJS)) |
---|
67 | InstallLibrary($(LIBRARY_g),$(USRLIBDIR)) |
---|
68 | #endif |
---|
69 | |
---|
70 | LintLibraryTarget($(LIBRARY_NAME),$(SRCS)) |
---|
71 | InstallLintLibrary($(LIBRARY_NAME),$(LINTLIBDIR)) |
---|
72 | |
---|
73 | BuildIncludes($(HEADERS),$(LIBRARY_NAME),..) |
---|
74 | InstallMultiple($(HEADERS),$(INCDIR)/$(LIBRARY_NAME)) |
---|
75 | |
---|
76 | DependTarget() |
---|
77 | |
---|
78 | NormalLintTarget($(SRCS)) |
---|
79 | |
---|
80 | XCOMM # End of Wcl Library Template for X11R5 |
---|
81 | #else |
---|
82 | XCOMM # Wcl Library Template for Pre-X11R5 |
---|
83 | XCOMM # |
---|
84 | |
---|
85 | /* This really does not work properly, but if your Imake configuration |
---|
86 | * really cannot support the widget sets you have, |
---|
87 | * |
---|
88 | * FIX YOUR IMAKE CONFIGURATION! |
---|
89 | * |
---|
90 | * I cannot do everything... (hey, its been a long day) |
---|
91 | */ |
---|
92 | #ifdef LibraryOptions |
---|
93 | CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES) LibraryOptions |
---|
94 | DEPENDFLAGS = LibraryOptions |
---|
95 | #endif |
---|
96 | |
---|
97 | LIBRARY_g = $(LIBRARY_NAME)$(DLX) |
---|
98 | LIBRARY_p = $(LIBRARY_NAME)_p |
---|
99 | |
---|
100 | all:: |
---|
101 | #if DoSharedLib |
---|
102 | # if DoDebugLib |
---|
103 | SharedAndDebuggedLibraryObjectRule() |
---|
104 | #define MySpecialRule(a,b,c) SpecialSharedAndDebuggedObjectRule(a,b,c) |
---|
105 | # else |
---|
106 | SharedLibraryObjectRule() |
---|
107 | #define MySpecialRule(a,b,c) SpecialSharedObjectRule(a,b,c) |
---|
108 | # endif |
---|
109 | #else |
---|
110 | # if DoDebugLib && DoProfileLib |
---|
111 | DebuggedAndProfiledLibraryObjectRule() |
---|
112 | #define MySpecialRule(a,b,c) SpecialDebuggedAndProfiledObjectRule(a,b,c) |
---|
113 | # else |
---|
114 | # if DoDebugLib |
---|
115 | DebuggedLibraryObjectRule() |
---|
116 | #define MySpecialRule(a,b,c) SpecialDebuggedObjectRule(a,b,c) |
---|
117 | # else |
---|
118 | # if DoProfileLib |
---|
119 | ProfiledLibraryObjectRule() |
---|
120 | #define MySpecialRule(a,b,c) SpecialProfiledObjectRule(a,b,c) |
---|
121 | # else |
---|
122 | NormalLibraryObjectRule() |
---|
123 | #define MySpecialRule(a,b,c) SpecialObjectRule(a,b,c) |
---|
124 | # endif |
---|
125 | # endif |
---|
126 | # endif |
---|
127 | #endif |
---|
128 | |
---|
129 | #ifndef SpecialLibObjectRule |
---|
130 | #define SpecialLibObjectRule(objs,deps,options) MySpecialRule(objs,deps,options) |
---|
131 | #endif |
---|
132 | |
---|
133 | #if HasSharedLibraries && DoSharedLib |
---|
134 | NormalSharedLibraryTarget($(LIBRARY_NAME),$(SOWCREV),$(OBJS)) |
---|
135 | InstallSharedLibrary($(LIBRARY_NAME),$(SOWCREV),$(USRLIBDIR)) |
---|
136 | #endif |
---|
137 | |
---|
138 | #if DoNormalLib |
---|
139 | NormalLibraryTarget($(LIBRARY_NAME),$(OBJS)) |
---|
140 | InstallLibrary($(LIBRARY_NAME),$(USRLIBDIR)) |
---|
141 | #endif |
---|
142 | |
---|
143 | LintLibraryTarget($(LIBRARY_NAME),$(SRCS)) |
---|
144 | InstallLintLibrary($(LIBRARY_NAME),$(LINTLIBDIR)) |
---|
145 | |
---|
146 | #if DoProfileLib |
---|
147 | ProfiledLibraryTarget($(LIBRARY_NAME),$(OBJS)) |
---|
148 | InstallLibrary($(LIBRARY_p),$(USRLIBDIR)) |
---|
149 | #endif |
---|
150 | |
---|
151 | #if DoDebugLib |
---|
152 | DebuggedLibraryTarget($(LIBRARY_NAME),$(OBJS)) |
---|
153 | InstallLibrary($(LIBRARY_g),$(USRLIBDIR)) |
---|
154 | #endif |
---|
155 | |
---|
156 | MakeDirectories(install,$(INCDIR)/$(LIBRARY_NAME)) |
---|
157 | InstallMultiple($(HEADERS),$(INCDIR)/$(LIBRARY_NAME)) |
---|
158 | BuildIncludes($(HEADERS),$(LIBRARY_NAME),..) |
---|
159 | |
---|
160 | DependTarget() |
---|
161 | |
---|
162 | NormalLintTarget($(SRCS)) |
---|
163 | |
---|
164 | XCOMM # End of Wcl Library Template for Pre-X11R5 |
---|
165 | #endif |
---|
166 | |
---|
167 | #ifdef UseTableFromXp |
---|
168 | /* Get Table sources before depending in "make World" |
---|
169 | */ |
---|
170 | includes:: Table.c TableLoc.c TableVec.c |
---|
171 | |
---|
172 | Table.c: ../Xp/Table.c |
---|
173 | rm -f Table.c ; $(LN) ../Xp/Table.c . |
---|
174 | |
---|
175 | TableLoc.c: ../Xp/TableLoc.c |
---|
176 | rm -f TableLoc.c ; $(LN) ../Xp/TableLoc.c . |
---|
177 | |
---|
178 | TableVec.c: ../Xp/TableVec.c |
---|
179 | rm -f TableVec.c ; $(LN) ../Xp/TableVec.c . |
---|
180 | #endif |
---|