-- $Source$
-- $State$

local d = ROOTDIR.."lang/cem/libcc/gen/"

local head = acklibrary {
	ackfile (d.."head_cc.e"),
	install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/c-knr.o")
}

local tail = acklibrary {
	ackfile (d.."abs.c"),
	ackfile (d.."atof.c"),
	ackfile (d.."strtod.c"),
	ackfile (d.."atoi.c"),
	ackfile (d.."atol.c"),
	ackfile (d.."strtol.c"),
	ackfile (d.."bcmp.c"),
	ackfile (d.."bfill.c"),
	ackfile (d.."bmove.c"),
	ackfile (d.."bzero.c"),
	ackfile (d.."calloc.c"),
	ackfile (d.."crypt.c"),
	ackfile (d.."ctime.c"),
	ackfile (d.."asctime.c"),
	ackfile (d.."execvp.c"),
	ackfile (d.."ffc.c"),
	ackfile (d.."ffs.c"),
	ackfile (d.."gcvt.c"),
	ackfile (d.."ecvt.c"),
	ackfile (d.."ext_comp.c"),
	ackfile (d.."getlogin.c"),
	ackfile (d.."index.c"),
	ackfile (d.."l3.c"),
	ackfile (d.."ldexp.c"),
	ackfile (d.."localtime.c"),
	ackfile (d.."gmtime.c"),
	ackfile (d.."memccpy.c"),
	ackfile (d.."memchr.c"),
	ackfile (d.."memcmp.c"),
	ackfile (d.."memcpy.c"),
	ackfile (d.."memset.c"),
	ackfile (d.."mktemp.c"),
	ackfile (d.."monitor.c"),
	ackfile (d.."perror.c"),
	ackfile (d.."procentry.c"),
	ackfile (d.."qsort.c"),
	ackfile (d.."bsearch.c"),
	ackfile (d.."rand.c"),
	ackfile (d.."seekdir.c"),
	ackfile (d.."sleep.c"),
	ackfile (d.."stb.c"),
	ackfile (d.."strstr.c"),
	ackfile (d.."strchr.c"),
	ackfile (d.."strcmp.c"),
	ackfile (d.."strcspn.c"),
	ackfile (d.."strncat.c"),
	ackfile (d.."strrchr.c"),
	ackfile (d.."strtok.c"),
	ackfile (d.."strpbrk.c"),
	ackfile (d.."strspn.c"),
	ackfile (d.."swab.c"),
	ackfile (d.."telldir.c"),
	ackfile (d.."ttyslot.c"),
	ackfile (d.."rindex.c"),
	ackfile (d.."strncmp.c"),
	ackfile (d.."ttyname.c"),
	ackfile (d.."closedir.c"),
	ackfile (d.."isatty.c"),
	ackfile (d.."opendir.c"),
	ackfile (d.."malloc.c"),
	ackfile (d.."bcopy.c"),
	ackfile (d.."readdir.c"),
	ackfile (d.."strcat.c"),
	ackfile (d.."strcpy.c"),
	ackfile (d.."strlen.c"),
	ackfile (d.."tzset.c"),
	ackfile (d.."getenv.c"),
	ackfile (d.."strncpy.c"),
	ackfile (d.."_c2type.c"),
	ackfile (d.."abort.e"),
	ackfile (d.."frexp.e"),
	ackfile (d.."modf.e"),
	ackfile (d.."setjmp.e"),

	install = pm.install("%BINDIR%%PLATIND%/%PLATFORM%/libc-knr.a")
}

lang_cem_gen_runtime = group {
	ACKINCLUDES = {PARENT, "%ROOTDIR%h"},
	
	head,
	tail
}
