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 PACKAGE_cmd ${INSTALLROOT}
setv PACKAGEROOT ../../../../..
setv CC cc
setv mam_cc_FLAGS
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??}
setv IFFEFLAGS
setv LDFLAGS
make .INIT
	make ${PACKAGE_ast_INCLUDE}/cmdlist.h
	done ${PACKAGE_ast_INCLUDE}/cmdlist.h
	exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${PACKAGE_ast_INCLUDE}/cmdlist.h
	bind -lcmd
done .INIT dontcare virtual
make install
	make pty
		make pty.o
			make pty.c
				make FEATURE/pty implicit
					make features/pty
					done features/pty
					exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
				done FEATURE/pty generated
				make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
				done ${PACKAGE_ast_INCLUDE}/ast_time.h
				prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit
				prev ${PACKAGE_ast_INCLUDE}/regex.h implicit
				make ${PACKAGE_ast_INCLUDE}/proc.h implicit
					prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
				done ${PACKAGE_ast_INCLUDE}/proc.h
				prev ${PACKAGE_ast_INCLUDE}/error.h implicit
				prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit
			done pty.c
			prev pty.c
			exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c
		done pty.o generated
		bind -lutil dontcare
		exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} -lm ${mam_libcmd}
	done pty generated
	make ${INSTALLROOT}/bin
		exec - if silent test ! -d ${INSTALLROOT}/bin
		exec - then mkdir -p ${INSTALLROOT}/bin
		exec - fi
	done ${INSTALLROOT}/bin generated
	make ${INSTALLROOT}/bin/pty
		prev pty
		exec - ${STDCMP} 2>/dev/null -s pty ${INSTALLROOT}/bin/pty || { ${STDMV} ${INSTALLROOT}/bin/pty ${INSTALLROOT}/bin/pty.old 2>/dev/null || true; ${STDCP} pty ${INSTALLROOT}/bin/pty ;}
	done ${INSTALLROOT}/bin/pty generated
	make ${INSTALLROOT}/bin
		exec - if silent test ! -d ${INSTALLROOT}/bin
		exec - then mkdir -p ${INSTALLROOT}/bin
		exec - fi
	done ${INSTALLROOT}/bin virtual
done install virtual
make test
done test dontcare virtual
