xref: /titanic_53/usr/src/contrib/ast/src/lib/libast/Makefile (revision 906afcb89d0412cc073b95c2d701a804a8cdb62c)
1*906afcb8SAndy Fiddaman/*
2*906afcb8SAndy Fiddaman * ast library
3*906afcb8SAndy Fiddaman */
4*906afcb8SAndy Fiddaman
5*906afcb8SAndy Fiddaman:PACKAGE: ast
6*906afcb8SAndy Fiddaman
7*906afcb8SAndy FiddamanLICENSE = since=1985,author=gsf+dgk+kpv
8*906afcb8SAndy Fiddaman
9*906afcb8SAndy FiddamanID = ast
10*906afcb8SAndy Fiddaman
11*906afcb8SAndy FiddamanHOSTTYPE == "$(CC.HOSTTYPE)"
12*906afcb8SAndy Fiddaman
13*906afcb8SAndy FiddamanCCFLAGS = $(CC.SUFFIX.DEBUG:+$(CC.DEBUG)) $(CC.OPTIMIZE) $(CC.DLL)
14*906afcb8SAndy Fiddaman
15*906afcb8SAndy FiddamanIFFEFLAGS = -v -X ast -X std
16*906afcb8SAndy Fiddaman
17*906afcb8SAndy Fiddaman.SOURCE : aso cdt comp dir disc hash man misc obsolete path port preroot \
18*906afcb8SAndy Fiddaman		regex sfio stdio string tm uwin vec vmalloc
19*906afcb8SAndy Fiddaman
20*906afcb8SAndy Fiddaman.SOURCE.h : include comp std cdt vmalloc
21*906afcb8SAndy Fiddaman
22*906afcb8SAndy FiddamanCP = $(STDCP|"cp")
23*906afcb8SAndy Fiddaman
24*906afcb8SAndy FiddamanPARANOID ==
25*906afcb8SAndy FiddamanCONF_LIBPREFIX == "$(CC.PREFIX.DYNAMIC|CC.PREFIX.SHARED)"
26*906afcb8SAndy FiddamanCONF_LIBSUFFIX == "$(CC.SUFFIX.DYNAMIC|CC.SUFFIX.SHARED)"
27*906afcb8SAndy FiddamanDEBUG ==
28*906afcb8SAndy Fiddaman__OBSOLETE__ == $("6 months ago":@F=%(%Y0101)T)
29*906afcb8SAndy Fiddaman
30*906afcb8SAndy FiddamanHEADERSRC = ast.h ast_dir.h ast_getopt.h ast_std.h \
31*906afcb8SAndy Fiddaman	ast_namval.h ast_windows.h \
32*906afcb8SAndy Fiddaman	ccode.h cdt.h cdtlib.h cmdarg.h debug.h dt.h error.h find.h ftw.h \
33*906afcb8SAndy Fiddaman	ftwalk.h fts.h fs3d.h getopt.h glob.h hash.h hashkey.h hashpart.h \
34*906afcb8SAndy Fiddaman	ip6.h lc.h ls.h magic.h mc.h mime.h mnt.h modecanon.h modex.h \
35*906afcb8SAndy Fiddaman	namval.h option.h proc.h re_comp.h recfmt.h regex.h regexp.h \
36*906afcb8SAndy Fiddaman	sfio.h sfio_s.h sfio_t.h sfdisc.h shcmd.h \
37*906afcb8SAndy Fiddaman	stack.h stak.h stk.h swap.h tar.h times.h tm.h tok.h \
38*906afcb8SAndy Fiddaman	usage.h vdb.h vecargs.h vmalloc.h wait.h wordexp.h \
39*906afcb8SAndy Fiddaman	bytesex.h endian.h fnmatch.h magicid.h fnv.h aso.h \
40*906afcb8SAndy Fiddaman	$(HEADERSTD)
41*906afcb8SAndy Fiddaman
42*906afcb8SAndy FiddamanHEADERGEN = align.h preroot.h sig.h tmx.h tv.h \
43*906afcb8SAndy Fiddaman	$(ID)_api.h $(ID)_botch.h $(ID)_ccode.h $(ID)_fcntl.h $(ID)_float.h \
44*906afcb8SAndy Fiddaman	$(ID)_fs.h $(ID)_lib.h $(ID)_map.h $(ID)_mmap.h $(ID)_mode.h $(ID)_ndbm.h \
45*906afcb8SAndy Fiddaman	$(ID)_param.h $(ID)_sys.h $(ID)_time.h $(ID)_time.h $(ID)_tty.h \
46*906afcb8SAndy Fiddaman	$(ID)_vfork.h $(ID)_wait.h $(ID)_limits.h $(ID)_standards.h $(ID)_sizeof.h \
47*906afcb8SAndy Fiddaman	$(HEADERSTD:/^/$(ID)_/)
48*906afcb8SAndy Fiddaman
49*906afcb8SAndy FiddamanHEADEREXP = $(ID)_common.h
50*906afcb8SAndy Fiddaman
51*906afcb8SAndy FiddamanHEADEROPT = fmtmsg.h libgen.h syslog.h
52*906afcb8SAndy Fiddaman
53*906afcb8SAndy FiddamanHEADERSTD = dirent.h iconv.h nl_types.h stdio.h wchar.h wctype.h
54*906afcb8SAndy Fiddaman
55*906afcb8SAndy Fiddaman$(ID) 5.4 :LIBRARY: README RELEASE \
56*906afcb8SAndy Fiddaman	LIBAST.3 aso.3 ast.3 astsa.3 cdt.3 chr.3 compat.3 error.3 \
57*906afcb8SAndy Fiddaman	find.3 fmt.3 fmtls.3 fs3d.3 ftwalk.3 getcwd.3 hash.3 iblocks.3 \
58*906afcb8SAndy Fiddaman	int.3 ip6.3 magic.3 mem.3 mime.3 modecanon.3 optget.3 path.3 \
59*906afcb8SAndy Fiddaman	preroot.3 proc.3 re.3 regex.3 setenviron.3 sfdisc.3 sfio.3 \
60*906afcb8SAndy Fiddaman	sig.3 spawnveg.3 stak.3 stk.3 strcopy.3 strdup.3 strelapsed.3 \
61*906afcb8SAndy Fiddaman	strerror.3 stresc.3 streval.3 strgid.3 strmatch.3 stropt.3 \
62*906afcb8SAndy Fiddaman	strperm.3 strsignal.3 strsort.3 strtape.3 strton.3 struid.3 \
63*906afcb8SAndy Fiddaman	swap.3 tab.3 tm.3 tmx.3 tok.3 touch.3 tv.3 vecargs.3 vmalloc.3 \
64*906afcb8SAndy Fiddaman	$(HEADERSRC) \
65*906afcb8SAndy Fiddaman	state.c transition.c \
66*906afcb8SAndy Fiddaman	dirlib.h opendir.c readdir.c rewinddir.c seekdir.c telldir.c \
67*906afcb8SAndy Fiddaman	getcwd.c fastfind.c \
68*906afcb8SAndy Fiddaman	hashlib.h hashalloc.c hashdump.c hashfree.c hashlast.c \
69*906afcb8SAndy Fiddaman	hashlook.c hashscan.c hashsize.c hashview.c hashwalk.c \
70*906afcb8SAndy Fiddaman	memhash.c memsum.c strhash.c strkey.c strsum.c \
71*906afcb8SAndy Fiddaman	stracmp.c strnacmp.c \
72*906afcb8SAndy Fiddaman	ccmap.c ccmapid.c ccnative.c \
73*906afcb8SAndy Fiddaman	chresc.c chrtoi.c streval.c strexpr.c strmatch.c strcopy.c \
74*906afcb8SAndy Fiddaman	modelib.h modei.c modex.c strmode.c \
75*906afcb8SAndy Fiddaman	strlcat.c strlcpy.c strlook.c strncopy.c strsearch.c strpsearch.c \
76*906afcb8SAndy Fiddaman	stresc.c stropt.c strtape.c strpcmp.c strnpcmp.c strvcmp.c strnvcmp.c \
77*906afcb8SAndy Fiddaman	tok.c tokline.c tokscan.c \
78*906afcb8SAndy Fiddaman	pathaccess.c pathcat.c pathcanon.c pathcheck.c pathpath.c \
79*906afcb8SAndy Fiddaman	pathexists.c pathfind.c pathkey.c pathprobe.c pathrepl.c \
80*906afcb8SAndy Fiddaman	pathnative.c pathposix.c pathtemp.c pathtmp.c pathstat.c \
81*906afcb8SAndy Fiddaman	pathgetlink.c pathsetlink.c pathbin.c pathshell.c pathcd.c \
82*906afcb8SAndy Fiddaman	pathprog.c \
83*906afcb8SAndy Fiddaman	fs3d.c ftwalk.c ftwflags.c fts.c \
84*906afcb8SAndy Fiddaman	astintercept.c conformance.c getenv.c setenviron.c \
85*906afcb8SAndy Fiddaman	optget.c optjoin.c optesc.c optctx.c strsort.c struniq.c \
86*906afcb8SAndy Fiddaman	magic.c mime.c mimetype.c signal.c sigflag.c systrace.c \
87*906afcb8SAndy Fiddaman	error.c errorf.c errormsg.c errorx.c \
88*906afcb8SAndy Fiddaman	localeconv.c setlocale.c translate.c \
89*906afcb8SAndy Fiddaman	catopen.c iconv.c lc.c lctab.c mc.c \
90*906afcb8SAndy Fiddaman	base64.c recfmt.c recstr.c reclen.c fmtrec.c \
91*906afcb8SAndy Fiddaman	fmtbase.c fmtbuf.c fmtclock.c fmtdev.c fmtelapsed.c fmterror.c \
92*906afcb8SAndy Fiddaman	fmtesc.c fmtfmt.c fmtfs.c fmtident.c fmtint.c fmtip4.c fmtip6.c fmtls.c \
93*906afcb8SAndy Fiddaman	fmtmatch.c fmtmode.c fmtnum.c fmtperm.c fmtre.c fmttime.c fmtuid.c \
94*906afcb8SAndy Fiddaman	fmtgid.c fmtsignal.c fmtscale.c fmttmx.c fmttv.c fmtversion.c \
95*906afcb8SAndy Fiddaman	strelapsed.c strperm.c struid.c strgid.c \
96*906afcb8SAndy Fiddaman	strtoip4.c strtoip6.c stack.c stk.c \
97*906afcb8SAndy Fiddaman	swapget.c swapmem.c swapop.c swapput.c \
98*906afcb8SAndy Fiddaman	sigdata.c sigcrit.c sigunblock.c \
99*906afcb8SAndy Fiddaman	proclib.h procopen.c procclose.c procrun.c procfree.c \
100*906afcb8SAndy Fiddaman	tmdate.c tmequiv.c tmfix.c tmfmt.c tmform.c tmgoff.c tminit.c \
101*906afcb8SAndy Fiddaman	tmleap.c tmlex.c tmlocale.c tmmake.c tmpoff.c tmscan.c \
102*906afcb8SAndy Fiddaman	tmsleep.c tmtime.c tmtype.c tmweek.c tmword.c tmzone.c \
103*906afcb8SAndy Fiddaman	tmxdate.c tmxduration.c tmxfmt.c tmxgettime.c tmxleap.c tmxmake.c \
104*906afcb8SAndy Fiddaman	tmxscan.c tmxsettime.c tmxsleep.c tmxtime.c tmxtouch.c \
105*906afcb8SAndy Fiddaman	tvcmp.c tvgettime.c tvsettime.c tvsleep.c tvtouch.c \
106*906afcb8SAndy Fiddaman	cmdarg.c vecargs.c vecfile.c vecfree.c vecload.c vecstring.c \
107*906afcb8SAndy Fiddaman	univlib.h univdata.c touch.c mnt.c debug.c \
108*906afcb8SAndy Fiddaman	memccpy.c memchr.c memcmp.c memcpy.c memdup.c memmove.c memset.c \
109*906afcb8SAndy Fiddaman	mkdir.c mkfifo.c mknod.c rmdir.c remove.c rename.c link.c unlink.c \
110*906afcb8SAndy Fiddaman	strdup.c strchr.c strrchr.c strstr.c \
111*906afcb8SAndy Fiddaman	strtod.c strtold.c \
112*906afcb8SAndy Fiddaman	strtol.c strtoll.c strtoul.c strtoull.c strton.c strtonll.c \
113*906afcb8SAndy Fiddaman	strntod.c strntold.c strnton.c strntonll.c \
114*906afcb8SAndy Fiddaman	strntol.c strntoll.c strntoul.c strntoull.c \
115*906afcb8SAndy Fiddaman	strcasecmp.c strncasecmp.c strerror.c \
116*906afcb8SAndy Fiddaman	mktemp.c tmpnam.c fsync.c \
117*906afcb8SAndy Fiddaman	execlp.c execve.c execvp.c execvpe.c spawnveg.c \
118*906afcb8SAndy Fiddaman	vfork.c killpg.c \
119*906afcb8SAndy Fiddaman	hsearch.c tsearch.c \
120*906afcb8SAndy Fiddaman	getlogin.c putenv.c setenv.c unsetenv.c \
121*906afcb8SAndy Fiddaman	lstat.c statvfs.c \
122*906afcb8SAndy Fiddaman	eaccess.c gross.c gross_sgi.h omitted.c \
123*906afcb8SAndy Fiddaman	fakelink.h readlink.c symlink.c \
124*906afcb8SAndy Fiddaman	getpgrp.c setpgid.c setsid.c waitpid.c \
125*906afcb8SAndy Fiddaman	creat64.c fcntl.c open.c \
126*906afcb8SAndy Fiddaman	atexit.c getdents.c getwd.c dup2.c errno.c \
127*906afcb8SAndy Fiddaman	getpreroot.c ispreroot.c realopen.c setpreroot.c \
128*906afcb8SAndy Fiddaman	getgroups.c mount.c system.c iblocks.c \
129*906afcb8SAndy Fiddaman	modedata.c tmdata.c \
130*906afcb8SAndy Fiddaman	memfatal.c sfkeyprintf.c \
131*906afcb8SAndy Fiddaman	sfdcdio.c sfdcdos.c sfdcfilter.c sfdcseekable.c \
132*906afcb8SAndy Fiddaman	sfdcslow.c sfdcsubstr.c sfdctee.c sfdcunion.c \
133*906afcb8SAndy Fiddaman	sfdcmore.c sfdcprefix.c \
134*906afcb8SAndy Fiddaman	wc.c wc2utf8.c \
135*906afcb8SAndy Fiddaman	/* standards */ \
136*906afcb8SAndy Fiddaman	basename.c closelog.c dirname.c fmtmsglib.c fnmatch.c ftw.c \
137*906afcb8SAndy Fiddaman	getdate.c getsubopt.c glob.c nftw.c openlog.c re_comp.c \
138*906afcb8SAndy Fiddaman	resolvepath.c realpath.c regcmp.c regexp.c setlogmask.c strftime.c \
139*906afcb8SAndy Fiddaman	strptime.c swab.c syslog.c sysloglib.h tempnam.c \
140*906afcb8SAndy Fiddaman	wordexp.c mktime.c \
141*906afcb8SAndy Fiddaman	/* regex */ \
142*906afcb8SAndy Fiddaman	reglib.h regalloc.c regclass.c regcoll.c regcomp.c regcache.c \
143*906afcb8SAndy Fiddaman	regdecomp.c regerror.c regexec.c regfatal.c reginit.c regnexec.c \
144*906afcb8SAndy Fiddaman	regsubcomp.c regsubexec.c regsub.c regrecord.c regrexec.c regstat.c \
145*906afcb8SAndy Fiddaman	/* cdt */ \
146*906afcb8SAndy Fiddaman	dthdr.h dtclose.c dtdisc.c dthash.c dtlist.c dtmethod.c \
147*906afcb8SAndy Fiddaman	dtopen.c dtstrhash.c dttree.c dtview.c dtwalk.c \
148*906afcb8SAndy Fiddaman	dtnew.c dtcomp.c \
149*906afcb8SAndy Fiddaman	/* sfio */ \
150*906afcb8SAndy Fiddaman	sfhdr.h sfdchdr.h \
151*906afcb8SAndy Fiddaman	sfclose.c sfclrlock.c sfdisc.c sfdlen.c sfexcept.c \
152*906afcb8SAndy Fiddaman	sfgetl.c sfgetu.c sfcvt.c sfecvt.c sffcvt.c \
153*906afcb8SAndy Fiddaman	sfextern.c sffilbuf.c sfflsbuf.c sfprints.c sfgetd.c \
154*906afcb8SAndy Fiddaman	sfgetr.c sfllen.c sfmode.c sfmove.c sfnew.c \
155*906afcb8SAndy Fiddaman	sfpkrd.c sfnotify.c sfnputc.c sfopen.c sfpeek.c sfpoll.c \
156*906afcb8SAndy Fiddaman	sfpool.c sfpopen.c sfprintf.c sfputd.c sfputl.c sfputr.c \
157*906afcb8SAndy Fiddaman	sfputu.c sfrd.c sfread.c sfreserve.c sfscanf.c sfseek.c sfset.c \
158*906afcb8SAndy Fiddaman	sfsetbuf.c sfsetfd.c sfsize.c sfsk.c sfstack.c sfstrtod.c sfsync.c \
159*906afcb8SAndy Fiddaman	sfswap.c sftable.c sftell.c sftmp.c sfungetc.c sfvprintf.c \
160*906afcb8SAndy Fiddaman	sfvscanf.c sfwr.c sfwrite.c sfpurge.c sfraise.c sfwalk.c \
161*906afcb8SAndy Fiddaman	sfgetm.c sfmutex.c sfputm.c sfresize.c \
162*906afcb8SAndy Fiddaman	_sfclrerr.c _sfeof.c _sferror.c _sffileno.c \
163*906afcb8SAndy Fiddaman	_sfopen.c _sfstacked.c _sfvalue.c \
164*906afcb8SAndy Fiddaman	_sfgetc.c _sfgetl.c _sfgetl2.c _sfgetu.c _sfgetu2.c \
165*906afcb8SAndy Fiddaman	_sfdlen.c _sfllen.c _sfslen.c _sfulen.c \
166*906afcb8SAndy Fiddaman	_sfputc.c _sfputd.c _sfputl.c _sfputm.c _sfputu.c \
167*906afcb8SAndy Fiddaman	/* stdio */ \
168*906afcb8SAndy Fiddaman	clearerr.c fclose.c fdopen.c feof.c ferror.c fflush.c \
169*906afcb8SAndy Fiddaman	fgetc.c fgetpos.c fgets.c fileno.c fopen.c fprintf.c \
170*906afcb8SAndy Fiddaman	fpurge.c fputc.c fputs.c fread.c freopen.c fscanf.c \
171*906afcb8SAndy Fiddaman	fseek.c fseeko.c fsetpos.c ftell.c ftello.c fwrite.c \
172*906afcb8SAndy Fiddaman	flockfile.c ftrylockfile.c funlockfile.c \
173*906afcb8SAndy Fiddaman	getc.c getchar.c getw.c pclose.c popen.c printf.c \
174*906afcb8SAndy Fiddaman	putc.c putchar.c puts.c putw.c rewind.c scanf.c \
175*906afcb8SAndy Fiddaman	setbuf.c setbuffer.c setlinebuf.c setvbuf.c \
176*906afcb8SAndy Fiddaman	snprintf.c sprintf.c sscanf.c \
177*906afcb8SAndy Fiddaman	asprintf.c vasprintf.c \
178*906afcb8SAndy Fiddaman	stdio/tmpfile.c ungetc.c vfprintf.c vfscanf.c vprintf.c \
179*906afcb8SAndy Fiddaman	vscanf.c vsnprintf.c vsprintf.c vsscanf.c \
180*906afcb8SAndy Fiddaman	_doprnt.c _doscan.c _filbuf.c _flsbuf.c _stdfun.c \
181*906afcb8SAndy Fiddaman	_stdopen.c _stdprintf.c _stdscanf.c _stdsprnt.c \
182*906afcb8SAndy Fiddaman	_stdvbuf.c _stdvsnprnt.c _stdvsprnt.c _stdvsscn.c \
183*906afcb8SAndy Fiddaman	/* wchar stdio */ \
184*906afcb8SAndy Fiddaman	fgetwc.c fwprintf.c putwchar.c vfwscanf.c wprintf.c \
185*906afcb8SAndy Fiddaman	fgetws.c fwscanf.c swprintf.c vswprintf.c wscanf.c \
186*906afcb8SAndy Fiddaman	fputwc.c getwc.c swscanf.c vswscanf.c \
187*906afcb8SAndy Fiddaman	fputws.c getwchar.c ungetwc.c vwprintf.c \
188*906afcb8SAndy Fiddaman	fwide.c putwc.c vfwprintf.c vwscanf.c \
189*906afcb8SAndy Fiddaman	/* stdio extensions */ \
190*906afcb8SAndy Fiddaman	stdio_c99.c fcloseall.c fmemopen.c getdelim.c getline.c \
191*906afcb8SAndy Fiddaman	/* math */ \
192*906afcb8SAndy Fiddaman	frexp.c frexpl.c \
193*906afcb8SAndy Fiddaman	/* ast */ \
194*906afcb8SAndy Fiddaman	astcopy.c astconf.c astdynamic.c astlicense.c astquery.c astwinsize.c \
195*906afcb8SAndy Fiddaman	conftab.c \
196*906afcb8SAndy Fiddaman	$(CC.LD.STATIC) aststatic.c getopt.c getoptl.c $(CC.LD.DYNAMIC) \
197*906afcb8SAndy Fiddaman	/* aso */ \
198*906afcb8SAndy Fiddaman	aso.c asolock.c asometh.c asorelax.c aso-sem.c aso-fcntl.c \
199*906afcb8SAndy Fiddaman	/* vmalloc */ \
200*906afcb8SAndy Fiddaman	vmalloc.h vmhdr.h vmbest.c vmclear.c vmclose.c vmdcheap.c vmdebug.c \
201*906afcb8SAndy Fiddaman	vmdisc.c vmexit.c vmlast.c vmopen.c vmpool.c vmprivate.c vmprofile.c \
202*906afcb8SAndy Fiddaman	vmregion.c vmsegment.c vmset.c vmstat.c vmstrdup.c vmtrace.c vmwalk.c \
203*906afcb8SAndy Fiddaman	vmmopen.c malloc.c vmgetmem.c \
204*906afcb8SAndy Fiddaman	/* uwin */ \
205*906afcb8SAndy Fiddaman	mathimpl.h rlib.h \
206*906afcb8SAndy Fiddaman	a64l.c acosh.c asinh.c atanh.c cbrt.c crypt.c erf.c \
207*906afcb8SAndy Fiddaman	err.c exp.c exp__E.c expm1.c gamma.c getpass.c lgamma.c log.c log1p.c \
208*906afcb8SAndy Fiddaman	log__L.c rand48.c random.c rcmd.c rint.c support.c \
209*906afcb8SAndy Fiddaman	/* obsolete */ \
210*906afcb8SAndy Fiddaman	sfstrtmp.c spawn.c \
211*906afcb8SAndy Fiddaman	-liconv -lw /* these should be pulled in by -lc */
212*906afcb8SAndy Fiddaman
213*906afcb8SAndy Fiddaman/*
214*906afcb8SAndy Fiddaman * man is stdio.h problematic
215*906afcb8SAndy Fiddaman * the std/stdio.h => ast_stdio.h runaround should
216*906afcb8SAndy Fiddaman * get to a steady state
217*906afcb8SAndy Fiddaman *
218*906afcb8SAndy Fiddaman * also, -D_BLD_ast must be explicit for the uwin bootstrap
219*906afcb8SAndy Fiddaman */
220*906afcb8SAndy Fiddaman
221*906afcb8SAndy Fiddaman.MAKEINIT : .AST.INIT
222*906afcb8SAndy Fiddaman.AST.INIT : .MAKE
223*906afcb8SAndy Fiddaman	CCFLAGS += -D_BLD_ast
224*906afcb8SAndy Fiddaman
225*906afcb8SAndy Fiddamanparameter	(_BLD_ast)
226*906afcb8SAndy Fiddamanvirtual		ast/stdio.h
227*906afcb8SAndy Fiddaman
228*906afcb8SAndy Fiddaman		:NOPROTECT: sfprintf.c sfvprintf.c sfscanf.c sfvscanf.c
229*906afcb8SAndy Fiddaman
230*906afcb8SAndy Fiddaman		:NOOPTIMIZE: spawnveg.c
231*906afcb8SAndy Fiddaman"ibm.risc"	:NOOPTIMIZE: regcomp.c
232*906afcb8SAndy Fiddaman"linux.i386-64*":NOOPTIMIZE: sfset.c
233*906afcb8SAndy Fiddaman"sol?.*"	:NOOPTIMIZE: sfrd.c sfvprintf.c tmxfmt.c
234*906afcb8SAndy Fiddaman"win32*"	:NOOPTIMIZE: fastfind.c mc.c
235*906afcb8SAndy Fiddaman"win32*-64*"	:NOOPTIMIZE: sfvprintf.c
236*906afcb8SAndy Fiddaman
237*906afcb8SAndy Fiddaman/*
238*906afcb8SAndy Fiddaman * NOTE: sun4 runtime link botches ro data so advertised sig_info is rw
239*906afcb8SAndy Fiddaman */
240*906afcb8SAndy Fiddaman
241*906afcb8SAndy Fiddaman:READONLY: conftab.c lctab.c modedata.c /*sftable.c*/ \
242*906afcb8SAndy Fiddaman	/*sigdata.c*/ tmdata.c univdata.c
243*906afcb8SAndy Fiddaman
244*906afcb8SAndy Fiddaman:: atmain.C \
245*906afcb8SAndy Fiddaman	stdgets.c stdprintf.c stdscanf.c stdvbuf.c stdsprnt.c \
246*906afcb8SAndy Fiddaman	stdvsprnt.c stdvsnprnt.c stdvsscn.c stdopen.c \
247*906afcb8SAndy Fiddaman	astsa
248*906afcb8SAndy Fiddaman
249*906afcb8SAndy Fiddamanif "$(PWD:B)" != "cc-*"
250*906afcb8SAndy Fiddaman
251*906afcb8SAndy Fiddaman$(INCLUDEDIR) :INSTALLPROTO: $(HEADEREXP) $(HEADERSRC) $(HEADERGEN)
252*906afcb8SAndy Fiddaman
253*906afcb8SAndy Fiddaman:INSTALLDIR: conf
254*906afcb8SAndy Fiddaman
255*906afcb8SAndy Fiddamanconf :: conf.sh
256*906afcb8SAndy Fiddaman
257*906afcb8SAndy Fiddamanconflim.h conftab.h conftab.c :JOINT: conf conf.tab
258*906afcb8SAndy Fiddaman	$(*:O=1:P=A) $(IFFEFLAGS:V:N=-v) $(*:O>1) $(CC) $(CCFLAGS:VP:N!=-D_BLD_*|$\(*\)) /* 2007-07-01: $(CCFLAGS:VPX:N!=-D_BLD_*) */
259*906afcb8SAndy Fiddaman
260*906afcb8SAndy Fiddaman$(HEADERGEN) :COPY: FEATURE/$$(<:B:/$(ID)_//)
261*906afcb8SAndy Fiddaman
262*906afcb8SAndy Fiddamanast_namval.h :COPY: namval.h
263*906afcb8SAndy Fiddaman
264*906afcb8SAndy Fiddamanlcgen : lcgen.c
265*906afcb8SAndy Fiddaman	$(CC.NATIVE|CC) -o $(<) $(*)
266*906afcb8SAndy Fiddaman
267*906afcb8SAndy Fiddamanlc.h lctab.c :JOINT: lcgen lc.tab
268*906afcb8SAndy Fiddaman	$(*:O=1:C,^[^/],./&,) $(tmp).1 $(tmp).2 < $(*:O=2) # :P=E: in 2006
269*906afcb8SAndy Fiddaman	$(PROTO) -p $(PROTOFLAGS) $(tmp).1 $(PROTOINSTALL) > $(tmp).3
270*906afcb8SAndy Fiddaman	$(RM) -f $(tmp).1
271*906afcb8SAndy Fiddaman	if	$(CMP) -s $(tmp).3 $(<:O=1)
272*906afcb8SAndy Fiddaman	then	$(RM) $(tmp).3
273*906afcb8SAndy Fiddaman	else	$(MV) $(tmp).3 $(<:O=1)
274*906afcb8SAndy Fiddaman	fi
275*906afcb8SAndy Fiddaman	if	$(CMP) -s $(tmp).2 $(<:O=2)
276*906afcb8SAndy Fiddaman	then	$(RM) $(tmp).2
277*906afcb8SAndy Fiddaman	else	$(MV) $(tmp).2 $(<:O=2)
278*906afcb8SAndy Fiddaman	fi
279*906afcb8SAndy Fiddaman
280*906afcb8SAndy Fiddaman$(LIBDIR)/file/magic :INSTALL: magic.tab
281*906afcb8SAndy Fiddaman
282*906afcb8SAndy Fiddaman:INSTALL: $(HEADEROPT:D=$(INCLUDEDIR):B:S)
283*906afcb8SAndy Fiddaman
284*906afcb8SAndy Fiddaman$(HEADEROPT:D=$(INCLUDEDIR):B:S) : $$(<:B:S) ast_lib.h
285*906afcb8SAndy Fiddaman	case $(CC.HOSTTYPE) in
286*906afcb8SAndy Fiddaman	win32.*)$(PROTO) -p $(PROTOFLAGS) $(*:O=1) $(PROTOINSTALL) > 1.$(tmp).x
287*906afcb8SAndy Fiddaman		if	$(CMP) -s $(<) 1.$(tmp).x
288*906afcb8SAndy Fiddaman		then	$(RM) -f 1.$(tmp).x
289*906afcb8SAndy Fiddaman		else	$(MV) 1.$(tmp).x $(<)
290*906afcb8SAndy Fiddaman		fi
291*906afcb8SAndy Fiddaman		;;
292*906afcb8SAndy Fiddaman	*)	$(SILENT) $(GREP) -l 'define[ 	][ 	]*_[hl][di][rb]_$(<:B)' $(*:O>1) > /dev/null || {
293*906afcb8SAndy Fiddaman		$(PROTO) -p $(PROTOFLAGS) $(*:O=1) $(PROTOINSTALL) > 1.$(tmp).x
294*906afcb8SAndy Fiddaman		if	$(CMP) -s $(<) 1.$(tmp).x
295*906afcb8SAndy Fiddaman		then	$(RM) -f 1.$(tmp).x
296*906afcb8SAndy Fiddaman		else	$(MV) 1.$(tmp).x $(<)
297*906afcb8SAndy Fiddaman		fi
298*906afcb8SAndy Fiddaman		}
299*906afcb8SAndy Fiddaman		;;
300*906afcb8SAndy Fiddaman	esac
301*906afcb8SAndy Fiddaman
302*906afcb8SAndy Fiddaman/*
303*906afcb8SAndy Fiddaman * FEATURE/common for iffe probes, <ast_common.h> for ast source
304*906afcb8SAndy Fiddaman * *but* <ast_common.h> may get pulled in by intercepted headers
305*906afcb8SAndy Fiddaman * so both must be built very early
306*906afcb8SAndy Fiddaman */
307*906afcb8SAndy Fiddaman
308*906afcb8SAndy Fiddaman$(ID)_common.h : .SCAN.IGNORE FEATURE/common
309*906afcb8SAndy Fiddaman	$(SED) '/define _def_map_ast/d' < $(*) > 1.$(tmp).x
310*906afcb8SAndy Fiddaman	if	$(CMP) -s $(<) 1.$(tmp).x
311*906afcb8SAndy Fiddaman	then	$(RM) -f 1.$(tmp).x
312*906afcb8SAndy Fiddaman	else	$(MV) 1.$(tmp).x $(<)
313*906afcb8SAndy Fiddaman	fi
314*906afcb8SAndy Fiddaman
315*906afcb8SAndy FiddamanFEATURE/common : .SCAN.IGNORE
316*906afcb8SAndy Fiddaman
317*906afcb8SAndy Fiddaman/*
318*906afcb8SAndy Fiddaman * more stdio.h complications ...
319*906afcb8SAndy Fiddaman * prepare for compilation by generating these headers first;
320*906afcb8SAndy Fiddaman * this helps mam by catching headers that might be indirectly
321*906afcb8SAndy Fiddaman * included on other systems
322*906afcb8SAndy Fiddaman */
323*906afcb8SAndy Fiddaman
324*906afcb8SAndy Fiddaman.check.hdr : .IGNORE .VIRTUAL \
325*906afcb8SAndy Fiddaman		FEATURE/standards - FEATURE/lib - FEATURE/common - \
326*906afcb8SAndy Fiddaman		FEATURE/param - FEATURE/aso - \
327*906afcb8SAndy Fiddaman		ast_map.h - ast_limits.h - ast_stdio.h ast_nl_types.h - \
328*906afcb8SAndy Fiddaman		ast_wchar.h ast_wctype.h
329*906afcb8SAndy Fiddaman	: clean up obsolete headers :
330*906afcb8SAndy Fiddaman	$(RM) -rf $(HEADERSTD) ast_hdr.h ast_types.h ast_unistd.h iffeio.h \
331*906afcb8SAndy Fiddaman		$(INCLUDEDIR)/limits.h $(INCLUDEDIR)/unistd.h \
332*906afcb8SAndy Fiddaman		$(PACKAGEROOT)/src/lib/libast/std/limits.h
333*906afcb8SAndy Fiddaman
334*906afcb8SAndy Fiddamanast.req : .check.hdr .check.lib
335*906afcb8SAndy Fiddaman
336*906afcb8SAndy Fiddamanelse
337*906afcb8SAndy Fiddaman
338*906afcb8SAndy Fiddamanast.req : .check.lib
339*906afcb8SAndy Fiddaman
340*906afcb8SAndy Fiddamanend
341*906afcb8SAndy Fiddaman
342*906afcb8SAndy Fiddaman/*
343*906afcb8SAndy Fiddaman * some systems move -lc routines to -lm
344*906afcb8SAndy Fiddaman * see astmath.c for details
345*906afcb8SAndy Fiddaman */
346*906afcb8SAndy Fiddaman
347*906afcb8SAndy Fiddaman.check.lib : .AFTER astmath.exe FEATURE/aso
348*906afcb8SAndy Fiddaman	$(SED) -e '/^#define _REQ_/!d' -e 's/#define _REQ_\([a-z0-9_]*\).*/ -l\1/' $(*:N=FEATURE/*) >> $(<<)
349*906afcb8SAndy Fiddaman	if	test -f astmath.exe
350*906afcb8SAndy Fiddaman	then	touch $(<<)
351*906afcb8SAndy Fiddaman	else	echo ' -lm' >> $(<<)
352*906afcb8SAndy Fiddaman	fi
353*906afcb8SAndy Fiddaman
354*906afcb8SAndy Fiddamanastmath.exe : .DONTCARE astmath.c
355*906afcb8SAndy Fiddaman	X=1
356*906afcb8SAndy Fiddaman	for N in 1 2 3 4 5 6 8
357*906afcb8SAndy Fiddaman	do	if	$(CC) -DN=$N -DIS $(CCFLAGS) -o $(*:N=*.c:B:S=.exe) $(*) 2>/dev/null
358*906afcb8SAndy Fiddaman		then	: implicit math function N=$N :
359*906afcb8SAndy Fiddaman		elif	$(CC) -DN=$N -DIS $(CCFLAGS) -o $(*:N=*.c:B:S=.exe) $(*) -lm 2>/dev/null
360*906afcb8SAndy Fiddaman		then	: math function N=$N requires -lm :
361*906afcb8SAndy Fiddaman			X=0
362*906afcb8SAndy Fiddaman			break
363*906afcb8SAndy Fiddaman		fi
364*906afcb8SAndy Fiddaman	done
365*906afcb8SAndy Fiddaman	case $X in
366*906afcb8SAndy Fiddaman	0)	$(RM) -f $(*:N=*.c:B:S=.exe) ;;
367*906afcb8SAndy Fiddaman	*)	touch $(*:N=*.c:B:S=.exe) ;;
368*906afcb8SAndy Fiddaman	esac
369*906afcb8SAndy Fiddaman	$(RM) -f $(*:N=*.c:B:S=$(CC.SUFFIX.OBJECT))
370*906afcb8SAndy Fiddaman
371*906afcb8SAndy Fiddaman/*
372*906afcb8SAndy Fiddaman * atmain.C is the only C++ and only for a few systems
373*906afcb8SAndy Fiddaman */
374*906afcb8SAndy Fiddaman
375*906afcb8SAndy Fiddamanatmain.o : atmain.C
376*906afcb8SAndy Fiddaman	ignore $(CC) -c $(CCFLAGS) $(*)
377*906afcb8SAndy Fiddaman	if	test ! -f $(<)
378*906afcb8SAndy Fiddaman	then	$(CP) $(*) $(*:B:S=.cpp)
379*906afcb8SAndy Fiddaman		ignore $(CC) -c $(CCFLAGS) $(*:B:S=.cpp)
380*906afcb8SAndy Fiddaman		if	test ! -f $(<)
381*906afcb8SAndy Fiddaman		then	$(CP) $(*) $(*:B:S=.c)
382*906afcb8SAndy Fiddaman			$(CC) -c $(CCFLAGS) $(*:B:S=.c)
383*906afcb8SAndy Fiddaman		fi
384*906afcb8SAndy Fiddaman	fi
385*906afcb8SAndy Fiddaman
386*906afcb8SAndy Fiddaman/* astsa is a standalone subset of ast for imbedded applications */
387*906afcb8SAndy Fiddaman
388*906afcb8SAndy FiddamanPAXFILTER = ;*.[ch];$(PROTO) $(PROTOFLAGS) -c "" -p
389*906afcb8SAndy Fiddaman
390*906afcb8SAndy Fiddamanast_sa.h : .DONTCARE
391*906afcb8SAndy Fiddaman
392*906afcb8SAndy Fiddamanastsa.tgz : $$("astsa/astsa.manifest":T=F:T=I:/[[:space:]][[:space:]]*/ /G:C,^,astsa/,)
393*906afcb8SAndy Fiddaman	$(PAX) $(PAXFLAGS) -wf $(<) -x $(<:/.*\.//) -s ',.*/,,' -A $(PAXFILTER:@Q) $(*)
394*906afcb8SAndy Fiddaman
395*906afcb8SAndy Fiddaman/* libmini.a is a bootstrap dll for uwin cc -D_BLD_ast that exports part of ast */
396*906afcb8SAndy Fiddaman
397*906afcb8SAndy FiddamanMINI = mini
398*906afcb8SAndy Fiddaman
399*906afcb8SAndy Fiddaman:: $(MINI).sym
400*906afcb8SAndy Fiddaman
401*906afcb8SAndy Fiddamanif CC.HOSTTYPE == "win32*"
402*906afcb8SAndy Fiddaman
403*906afcb8SAndy FiddamanDLL = $(ID)$(VERSION:/[^0-9]//G)
404*906afcb8SAndy Fiddaman
405*906afcb8SAndy Fiddaman$(MINI) : $(MINI)$$(CC.SUFFIX.SHARED)
406*906afcb8SAndy Fiddaman
407*906afcb8SAndy Fiddaman$(MINI)$$(CC.SUFFIX.SHARED) : $(MINI).sym $(ID)
408*906afcb8SAndy Fiddaman	$(RM) -rf $(MINI).tmp
409*906afcb8SAndy Fiddaman	mkdir $(MINI).tmp
410*906afcb8SAndy Fiddaman	{
411*906afcb8SAndy Fiddaman	echo LIBRARY $(DLL:F=%(upper)s)
412*906afcb8SAndy Fiddaman	echo
413*906afcb8SAndy Fiddaman	echo SECTIONS
414*906afcb8SAndy Fiddaman	echo .data READ WRITE
415*906afcb8SAndy Fiddaman	echo
416*906afcb8SAndy Fiddaman	echo EXPORTS
417*906afcb8SAndy Fiddaman	cat $(*:N=*.sym)
418*906afcb8SAndy Fiddaman	} > $(MINI).tmp/$(DLL)$(CC.SUFFIX.LD:O=1)
419*906afcb8SAndy Fiddaman	cd $(MINI).tmp
420*906afcb8SAndy Fiddaman	$(LD) $(CCFLAGS:N=-[gG]*) $(CC.SHARED) -o $(DLL) $(DLL)$(CC.SUFFIX.LD:O=1) $(*$(ID).so/$(DLL)$(CC.SUFFIX.DYNAMIC):C,^[^-],../&,)
421*906afcb8SAndy Fiddaman	cd ..
422*906afcb8SAndy Fiddaman	$(MV) $(MINI).tmp/$(DLL)$(CC.SUFFIX.SHARED) $(<)
423*906afcb8SAndy Fiddaman	$(RM) -rf $(MINI).tmp
424*906afcb8SAndy Fiddaman
425*906afcb8SAndy Fiddamanend
426*906afcb8SAndy Fiddaman
427*906afcb8SAndy Fiddaman:MSGKEY: misc/magic.tab
428*906afcb8SAndy Fiddaman	$(SED) \
429*906afcb8SAndy Fiddaman		-e '/^#/d' \
430*906afcb8SAndy Fiddaman		-e '/[^	]*		*[^	]*		*[^	]*		*./!d' \
431*906afcb8SAndy Fiddaman		-e 's,^[^	]*		*[^	]*		*[^	]*		*\(.[^	]*\).*$,\1,' \
432*906afcb8SAndy Fiddaman		-e 's,[\\"],\\&,g' \
433*906afcb8SAndy Fiddaman		-e 's,.*,"&",' \
434*906afcb8SAndy Fiddaman		$(*)
435