note *
note * This build file is in the Make Abstract Machine (MAM) language. It was
note * first generated by nmake, but in the ksh 93u+m distribution we maintain
note * it manually because nmake had too many problems to keep using. The
note * Mamfiles are processed by mamake (src/cmd/INIT/mamake.c); we added
note * indentation to improve readability. The language is documented in
note * src/cmd/INIT/README-mamake.md.
note *
setv INSTALLROOT ../../..
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
setv PACKAGEROOT ../../../../..
setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS}
setv CC cc
setv mam_cc_FLAGS ${mam_cc_DLL}
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv COTEMP $$
setv IFFEFLAGS
setv LDFLAGS
make install
	make dll
		make libdll.a archive
			make dll.req
				exec - set -
				exec - echo 'int main(){return 0;}' > 1.${COTEMP}.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -c 1.${COTEMP}.c &&
				exec - x=`${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l'*' 2>&1 | sed -e 's/[][()+@?]/#/g' || :` &&
				exec - {
				exec - case "" in
				exec - *?) echo " " ;;
				exec - esac
				exec - for i in dll dl dld ast
				exec - do case $i in
				exec - "dll"|dll)
				exec - ;;
				exec - *) if test -f ${INSTALLROOT}/lib/lib/$i
				exec - then y=`cat ${INSTALLROOT}/lib/lib/$i`
				exec - case $y in
				exec - *-?*) echo "" $y ;;
				exec - esac
				exec - continue
				exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a
				exec - then case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
				exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in
				exec - *$x*) continue ;;
				exec - esac
				exec - ;;
				exec - esac
				exec - fi
				exec - ;;
				exec - esac
				exec - echo " -l$i"
				exec - done
				exec - } > dll.req
				exec - rm -f 1.${COTEMP}.*
			done dll.req generated
			make dlfcn.o
				make dlfcn.c
					make dll.h implicit
					done dll.h dontcare virtual
					make xcoff.h implicit
					done xcoff.h dontcare virtual
					make dl.h implicit
					done dl.h dontcare virtual
					make ${PACKAGE_ast_INCLUDE}/error.h implicit
						make ${PACKAGE_ast_INCLUDE}/option.h implicit
							make ${PACKAGE_ast_INCLUDE}/ast.h implicit
								make ${PACKAGE_ast_INCLUDE}/ast_api.h implicit
								done ${PACKAGE_ast_INCLUDE}/ast_api.h dontcare
								make ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
									make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
										make ${PACKAGE_ast_INCLUDE}/ast_map.h implicit
										done ${PACKAGE_ast_INCLUDE}/ast_map.h dontcare
										make ${PACKAGE_ast_INCLUDE}/endian.h implicit
											make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit
												prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
											done ${PACKAGE_ast_INCLUDE}/bytesex.h dontcare
										done ${PACKAGE_ast_INCLUDE}/endian.h dontcare
									done ${PACKAGE_ast_INCLUDE}/ast_common.h dontcare
									make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
										make ${PACKAGE_ast_INCLUDE}/regex.h implicit
											prev ${PACKAGE_ast_INCLUDE}/ast_api.h implicit
											make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit
												make ${PACKAGE_ast_INCLUDE}/wctype.h implicit
													make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit
														prev ${PACKAGE_ast_INCLUDE}/endian.h implicit
														make ${PACKAGE_ast_INCLUDE}/wchar.h implicit
															prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit
														done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare
													done ${PACKAGE_ast_INCLUDE}/ast_wctype.h dontcare
												done ${PACKAGE_ast_INCLUDE}/wctype.h dontcare
												make ${PACKAGE_ast_INCLUDE}/stdio.h implicit
													make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit
														make ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit
														done ${PACKAGE_ast_INCLUDE}/sfio_s.h dontcare
														prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
													done ${PACKAGE_ast_INCLUDE}/ast_stdio.h dontcare
												done ${PACKAGE_ast_INCLUDE}/stdio.h dontcare
												prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit
												prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
											done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare
											prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
										done ${PACKAGE_ast_INCLUDE}/regex.h dontcare
										make ${PACKAGE_ast_INCLUDE}/getopt.h implicit
											make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit
											done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare
										done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare
										prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit
										make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit
										done ${PACKAGE_ast_INCLUDE}/ast_botch.h dontcare
										make ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit
										done ${PACKAGE_ast_INCLUDE}/ast_limits.h dontcare
										make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit
											make ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit
											done ${PACKAGE_ast_INCLUDE}/ast_fs.h dontcare
										done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h dontcare
										prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit
										make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit
											prev ${PACKAGE_ast_INCLUDE}/getopt.h implicit
											prev ${PACKAGE_ast_INCLUDE}/endian.h implicit
											prev ${PACKAGE_ast_INCLUDE}/endian.h implicit
										done ${PACKAGE_ast_INCLUDE}/ast_sys.h dontcare
										make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit
										done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare
										prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
									done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare
								done ${PACKAGE_ast_INCLUDE}/vmalloc.h dontcare
								make ${PACKAGE_ast_INCLUDE}/sfio.h implicit
									prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit
									prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
									prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
								done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare
								prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
							done ${PACKAGE_ast_INCLUDE}/ast.h dontcare
						done ${PACKAGE_ast_INCLUDE}/option.h dontcare
						prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
					done ${PACKAGE_ast_INCLUDE}/error.h
					make dlldefs.h implicit
						make FEATURE/dll
							make features/dll
							done features/dll
							bind -ldl dontcare
							bind -last
							exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdl} ${mam_libast} : run features/dll
						done FEATURE/dll generated
						exec - cmp -s FEATURE/dll dlldefs.h || { rm -f dlldefs.h; silent test -d . || mkdir .; cp FEATURE/dll dlldefs.h; }
					done dlldefs.h generated
					prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
				done dlfcn.c
				prev dlfcn.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dlfcn.c
			done dlfcn.o generated
			make dllopen.o
				make dllopen.c
					make dlllib.h implicit
						prev ${PACKAGE_ast_INCLUDE}/error.h implicit
						prev dlldefs.h implicit
						prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
					done dlllib.h
				done dllopen.c
				prev dllopen.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllopen.c
			done dllopen.o generated
			make dllfind.o
				make dllfind.c
					prev ${PACKAGE_ast_INCLUDE}/error.h implicit
					prev dlldefs.h implicit
					prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
				done dllfind.c
				prev dllfind.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllfind.c
			done dllfind.o generated
			make dllplug.o
				make dllplug.c
					prev dlllib.h implicit
				done dllplug.c
				prev dllplug.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllplug.c
			done dllplug.o generated
			make dll_lib.o
				make dll_lib.c
					prev dlllib.h implicit
				done dll_lib.c
				prev dll_lib.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dll_lib.c
			done dll_lib.o generated
			make dllnext.o
				make dllnext.c
					make rld_interface.h implicit
					done rld_interface.h dontcare virtual
					prev dlldefs.h implicit
					prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
				done dllnext.c
				prev dllnext.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dllnext.c
			done dllnext.o generated
			make dlllook.o
				make dlllook.c
					prev dlldefs.h implicit
					prev ${PACKAGE_ast_INCLUDE}/error.h implicit
					prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
				done dlllook.c
				prev dlllook.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dlllook.c
			done dlllook.o generated
			make dllscan.o
				make dllscan.c
					prev dlldefs.h implicit
					prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
					make ${PACKAGE_ast_INCLUDE}/fts.h implicit
						make ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit
						done ${PACKAGE_ast_INCLUDE}/ast_mode.h dontcare
						prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit
						prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
					done ${PACKAGE_ast_INCLUDE}/fts.h
					prev ${PACKAGE_ast_INCLUDE}/error.h implicit
					prev ${PACKAGE_ast_INCLUDE}/endian.h implicit
					make ${PACKAGE_ast_INCLUDE}/cdt.h implicit
						prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit
						prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit
					done ${PACKAGE_ast_INCLUDE}/cdt.h
					prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
				done dllscan.c
				prev dllscan.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} -I. -I${PACKAGE_ast_INCLUDE} -D_BLD_dll -D_PACKAGE_ast -c dllscan.c
			done dllscan.o generated
			make dllcheck.o
				make dllcheck.c
					prev dlllib.h implicit
				done dllcheck.c
				prev dllcheck.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllcheck.c
			done dllcheck.o generated
			make dllerror.o
				make dllerror.c
					prev dlllib.h implicit
				done dllerror.c
				prev dllerror.c
				exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_dll -c dllerror.c
			done dllerror.o generated
			exec - ${AR} rc libdll.a dlfcn.o dllopen.o dllfind.o dllplug.o dll_lib.o dllnext.o dlllook.o dllscan.o dllcheck.o dllerror.o
			exec - (ranlib libdll.a) >/dev/null 2>&1 || true
		done libdll.a generated
	done dll virtual
	prev libdll.a archive
	make ${INSTALLROOT}/lib
		exec - if silent test ! -d ${INSTALLROOT}/lib
		exec - then mkdir -p ${INSTALLROOT}/lib
		exec - fi
	done ${INSTALLROOT}/lib generated
	make ${INSTALLROOT}/lib/libdll.a archive
		prev ${INSTALLROOT}/lib
		prev libdll.a archive
		exec - ${STDCMP} 2>/dev/null -s libdll.a ${INSTALLROOT}/lib/libdll.a || { ${STDMV} ${INSTALLROOT}/lib/libdll.a ${INSTALLROOT}/lib/libdll.a.old 2>/dev/null || true; ${STDCP} libdll.a ${INSTALLROOT}/lib/libdll.a ;}
		exec - (ranlib ${INSTALLROOT}/lib/libdll.a) >/dev/null 2>&1 || true
	done ${INSTALLROOT}/lib/libdll.a generated
	make ${INSTALLROOT}/lib/lib
		exec - if silent test ! -d ${INSTALLROOT}/lib/lib
		exec - then mkdir -p ${INSTALLROOT}/lib/lib
		exec - fi
	done ${INSTALLROOT}/lib/lib generated
	make ${INSTALLROOT}/lib/lib/dll
		prev ${INSTALLROOT}/lib/lib
		prev dll.req
		exec - ${STDCMP} 2>/dev/null -s dll.req ${INSTALLROOT}/lib/lib/dll || { ${STDMV} ${INSTALLROOT}/lib/lib/dll ${INSTALLROOT}/lib/lib/dll.old 2>/dev/null || true; ${STDCP} dll.req ${INSTALLROOT}/lib/lib/dll ;}
	done ${INSTALLROOT}/lib/lib/dll generated
	make ${PACKAGE_ast_INCLUDE}
		exec - if silent test ! -d ${PACKAGE_ast_INCLUDE}
		exec - then mkdir -p ${PACKAGE_ast_INCLUDE}
		exec - fi
	done ${PACKAGE_ast_INCLUDE} generated
	make ${PACKAGE_ast_INCLUDE}/dlldefs.h
		prev ${PACKAGE_ast_INCLUDE}
		prev dlldefs.h
		exec - if ! cmp -s dlldefs.h ${PACKAGE_ast_INCLUDE}/dlldefs.h
		exec - then ${STDCP} dlldefs.h ${PACKAGE_ast_INCLUDE}/dlldefs.h
		exec - fi
	done ${PACKAGE_ast_INCLUDE}/dlldefs.h generated
done install virtual
make test
done test dontcare virtual
