File: Local.rules

package info (click to toggle)
xpilot 4.5.5beta.20031222-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,696 kB
  • ctags: 8,771
  • sloc: ansic: 85,922; cpp: 4,282; tcl: 3,479; sh: 1,731; makefile: 334; perl: 134
file content (262 lines) | stat: -rw-r--r-- 8,390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/* $Id: Local.rules,v 5.1 2003/12/13 21:22:36 bertg Exp $
 *
 * NO NEED TO EDIT THIS FILE; ONLY EDIT Local.config.
 */

/* Some Imake configurations still don't have XCOMM defined, shame on them */
#ifndef XCOMM
#define XCOMM #
#endif
/* And some don't have NullParameter either, double shame */
#ifndef NullParameter
#define NullParameter
#endif

/* The deprecated InstallNonExec must be used on systems that don't 
 * have the newer InstallNonExecFile. */
#ifndef InstallNonExecFile
#define InstallNonExecFile	InstallNonExec
#endif

/*
 * The following rules are similar to to the ComplexProgramTarget_n family
 * except they install the binaries in $(INSTBINDIR) instead of $(BINDIR),
 * thereby circumventing the problem that auxilary programs X's Imake.rules
 * uses have to be situated in the same directory as you want your binary
 * installed in.  (Such dependencies are errors of the Imake files for X IMO.)
 *
 * Another difference is that these macros doesn't install the manual
 * automatically -- you have to invoke the install.man target manually
 * so it's not so counter-intuitive to invoke the install.man rule
 * explicitly too, besides, you might not have a manual page in this
 * directory, or at all.
 */
#ifndef ProgramTarget
#define	ProgramTarget(program,locallib,syslib)				@@\
                                                                        @@\
AllTarget($(PROGRAMS))							@@\
                                                                        @@\
program: $(OBJS) $(DEPLIBS)						@@\
	RemoveTargetProgram($@)						@@\
	$(CC) -o $@ $(LDOPTIONS) $(OBJS) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
									@@\
InstallProgram(program,$(INSTBINDIR))					@@\
                                                                        @@\
DependTarget()								@@\
LintTarget()								@@\
                                                                        @@\
clean::									@@\
	$(RM) $(PROGRAMS)
#endif /* ProgramTarget */


#ifndef ProgramTarget_1
#define	ProgramTarget_1(program,locallib,syslib)			@@\
            OBJS = $(OBJS1) $(OBJS2) $(OBJS3)				@@\
            SRCS = $(SRCS1) $(SRCS2) $(SRCS3)				@@\
                                                                        @@\
AllTarget($(PROGRAMS))							@@\
                                                                        @@\
program: $(OBJS1) $(DEPLIBS1)						@@\
	RemoveTargetProgram($@)						@@\
	$(CC) -o $@ $(LDOPTIONS) $(OBJS1) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
									@@\
InstallProgram(program,$(INSTBINDIR))					@@\
                                                                        @@\
DependTarget()								@@\
LintTarget()								@@\
                                                                        @@\
clean::									@@\
	$(RM) $(PROGRAMS)
#endif /* ProgramTarget_1 */


#ifndef ProgramTarget_2
#define	ProgramTarget_2(program,locallib,syslib)			@@\
program: $(OBJS2) $(DEPLIBS2)						@@\
	RemoveTargetProgram($@)						@@\
	$(CC) -o $@ $(LDOPTIONS) $(OBJS2) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
                                                                        @@\
InstallProgram(program,$(INSTBINDIR))
#endif /* ProgramTarget_2 */


#ifndef ProgramTarget_3
#define	ProgramTarget_3(program,locallib,syslib)			@@\
program: $(OBJS3) $(DEPLIBS3)						@@\
	RemoveTargetProgram($@)						@@\
	$(CC) -o $@ $(LDOPTIONS) $(OBJS3) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
                                                                        @@\
InstallProgram(program,$(INSTBINDIR))
#endif /* ProgramTarget_3 */



/*
	Create target by running through msub.
*/
#define MsubTarget(dest,src)						@@\
AllTarget(dest)								@@\
dest: $(MSUB) src							@@\
	$(MSUB) $(MSUBFLAGS) src >dest					@@\
StuffToClean(dest)

#define MsubTargetPersistent(dest,src)					@@\
AllTarget(dest)								@@\
dest: $(MSUB) src							@@\
	$(RM) dest							@@\
	$(MSUB) $(MSUBFLAGS) src >dest

/* Add MsubDepend once to each Imakefile which uses Msub Targets. */
#define MsubDepend							@@\
$(MSUB): $(MSUB).o $(MSUB).c						@@\
	@echo "Checking $@ over in $(MSUBSRC) first.."; \		@@\
	cd $(MSUBSRC) || exit 1; $(MAKE) || exit 1; \			@@\
	echo "Okay, continuing in $(CURRENT_DIR)"


/*
 * These rules are from the imake.support file of the msub package.
 */
/*
	Create a target by running a template through some filter.
*/

#ifndef	ScriptFromTemplateTarget
#define	ScriptFromTemplateTarget(dst,src,command,deps)			@@\
AllTarget(dst)								@@\
StuffToClean(dst)							@@\
dst:: src deps								@@\
	command src > $@
#endif


/*
	Create an executable target for some arbitrary program by running a
	template through some filter.  prog must be a full pathname.

	If the ExecableScripts configuration parameter is not YES, make sure
	the first line begins with a colon and write the script into a temp
	file, have the program execute that, and remove the temp file when
	done.  Ugly ugly ugly.
*/

#ifndef	ExecScriptFromTemplateTarget
#if ExecableScripts		/* can use #! */
#define	ExecScriptFromTemplateTarget(prog,dst,src,command,deps)		@@\
AllTarget(dst)								@@\
StuffToClean(dst)							@@\
dst::  src deps								@@\
	$(RM) $@							@@\
	echo "#!"prog > $@						@@\
	command src >> $@						@@\
	chmod a+x $@
#else
#define	ExecScriptFromTemplateTarget(prog,dst,src,command,deps)		@@\
AllTarget(dst)								@@\
StuffToClean(dst)							@@\
dst::  src deps								@@\
	$(RM) $@							@@\
	echo \: > $@							@@\
	echo 'x=/tmp/xx$$$$' >> $@					@@\
	echo "cat > "'$$x'" << 'EOF'" >> $@				@@\
	command src >> $@						@@\
	echo EOF >> $@							@@\
	echo prog '$$x' '$$@' >> $@					@@\
	echo $(RM) '$$x' >> $@						@@\
	chmod a+x $@
#endif /* ExecableScripts */
#endif /* ExecScriptFromTemplateTarget */


/* From X11R6 Imake.rules file:
 * MakeMakeSubdirs - generate rules to recursively recreate Makefiles as part
 * of the specified step in the build.  If $(TOP) is set to an absolute path, 
 * do not prepend the ../ prefix.  This makes running things outside of the 
 * source tree to be much easier.
 */
#ifdef MakeMakeSubdirs
#undef MakeMakeSubdirs
#endif
#define MakeMakeSubdirs(dirs,target)					@@\
target::								@@\
	-@case '${MFLAGS}' in *[ik]*) set +e;; esac; \			@@\
	case '${MFLAGS}' in *n*) executeit="no";; esac; \		@@\
	for i in dirs ;\						@@\
	do \								@@\
		case "$(CURRENT_DIR)" in \				@@\
		.) curdir= ;; \						@@\
		*) curdir=$(CURRENT_DIR)/ ;; \				@@\
		esac; \							@@\
		echo "making Makefiles in $$curdir$$i..."; \		@@\
		case "$$i" in \						@@\
		*/?*/?*/?*)	newtop=../../../..;; \			@@\
		*/?*/?*)	newtop=../../..;; \			@@\
		*/?*)		newtop=../..;; \			@@\
		*)		newtop=..;; \				@@\
		esac; \							@@\
		case "$(TOP)" in \					@@\
		/?*) imaketop=$(TOP) \					@@\
		     imakeprefix= ;; \					@@\
		.) imaketop=$$newtop \					@@\
		   imakeprefix=$$newtop/ ;; \				@@\
		*) imaketop=$$newtop/$(TOP) \				@@\
		   imakeprefix=$$newtop/ ;; \				@@\
		esac; \							@@\
		cd $$i || exit 1; \					@@\
		$(RM) Makefile.bak;	 \				@@\
		if [ -f Makefile ]; then \				@@\
			echo "	$(MV) Makefile Makefile.bak"; \		@@\
			if [ "$$executeit" != "no" ]; then \		@@\
				$(MV) Makefile Makefile.bak; \		@@\
			fi; \						@@\
		fi; \							@@\
		if [ "$$executeit" != "no" ]; then \			@@\
			ImakeSubCmdHelper -DTOPDIR=$$imaketop -DCURDIR=$$curdir$$i; \ @@\
		fi; \							@@\
		$(MAKE) $(MFLAGS) Makefiles; \				@@\
		cd $$newtop || exit 1; \				@@\
	done

#ifdef ImakeSubCmdHelper
#undef ImakeSubCmdHelper
#endif
#ifdef UseInstalled
#define ImakeSubCmdHelper $(IMAKE_CMD)
#else
#define ImakeSubCmdHelper $$imakeprefix$(IMAKE) -I$$imakeprefix$(IRULESRC) $(IMAKE_DEFINES)
#endif



#ifndef CtagFiles
#define CtagFiles(extra)						@@\
ctags::									@@\
	$(CTAGS) $(CTAGOPTIONS) extra
#endif /* CtagFiles */


#ifndef CtagSubdirs
#define CtagSubdirs(extra)						@@\
ctags::									@@\
	@for flag in ${MAKEFLAGS} ''; do \				@@\
	case "$$flag" in *=*) ;; *[ik]*) set +e;; esac; done; \		@@\
	for i in extra ;\						@@\
	do \								@@\
	echo "tagging" "in $(CURRENT_DIR)/$$i..."; \			@@\
	$(MAKE) -C $$i CTAGS='$(CTAGS)' CTAGOPTIONS='$(CTAGOPTIONS)' ctags; \	@@\
	done
#endif /* CtagSubdirs */


#ifndef StuffToClean
#define StuffToClean(extra)						@@\
clean::									@@\
	$(RM) extra
#endif /* StuffToClean */


#ifndef AllTarget
#define AllTarget(depends)						@@\
all:: depends
#endif /* AllTarget */