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