#sccs	"@(#)libc/port/gen:Makefile	1.9"

#
# makefile for libc/port/gen
#
#

.SUFFIXES: .p

include $(MAKEINC)/Makepre.h

LCFLAGS = $(CRYPT)

OBJECTS=\
a64l.o        abort.o       abs.o         assert.o	\
atof.o        atoi.o        atol.o        biglitpow.o	bsearch.o	\
calloc.o      clock.o       crypt.o       ctime.o	ctdata.o \
ctype.o       dial.o        drand48.o     dtop.o	ecvt.o	\
cuexit.o  errlst.o      execvp.o      fakcu.o       \
ftok.o        ftw.o         gcvt.o        getcwd.o	\
getenv.o      getgrent.o    getgrgid.o    getgrnam.o	\
getlogin.o    getopt.o      getpw.o       getpwent.o	\
getpwnam.o    getpwuid.o    getut.o       hsearch.o     isatty.o	\
l3.o          l64a.o        ldexp.o       lfind.o       lsearch.o  ltostr.o \
malloc.o      memccpy.o     memchr.o      memcmp.o	\
memcpy.o      memset.o      mktemp.o      modf.o	\
mon.o         nlist.o       perror.o      ptod.o	putpwent.o	\
putenv.o \
qsort.o       rand.o        sleep.o       ssignal.o	\
strcat.o      strchr.o      strcmp.o      strcpy.o	\
strcspn.o     strlen.o      strncat.o     strncmp.o	\
strncpy.o     strpbrk.o     strrchr.o     strspn.o	strtod.o	\
strtok.o      strtol.o      swab.o        tell.o	tfind.o		\
tolower.o     toupper.o     tsearch.o     ttyname.o	\
ttyslot.o 

POBJECTS=\
a64l.p        abort.p       abs.p         assert.p	\
atof.p        atoi.p        atol.p        biglitpow.p	bsearch.p	\
calloc.p      clock.p       crypt.p       ctime.p	ctdata.p \
ctype.p       dial.p        drand48.p     dtop.p	ecvt.p	\
cuexit.p	errlst.p      execvp.p      fakcu.p       \
ftok.p        ftw.p         gcvt.p        getcwd.p	\
getenv.p      getgrent.p    getgrgid.p    getgrnam.p	\
getlogin.p    getopt.p      getpw.p       getpwent.p	\
getpwnam.p    getpwuid.p    \
getut.p       hsearch.p     isatty.p	\
l3.p          l64a.p        ldexp.p       lfind.p      lsearch.p  ltostr.p\
malloc.p      memccpy.p     memchr.p      memcmp.p	\
memcpy.p      memset.p      mktemp.p      modf.p	\
mon.p         nlist.p       perror.p      ptod.p	putpwent.p	\
putenv.p \
qsort.p       rand.p        sleep.p       ssignal.p	\
strcat.p      strchr.p      strcmp.p      strcpy.p	\
strcspn.p     strlen.p      strncat.p     strncmp.p	\
strncpy.p     strpbrk.p     strrchr.p     strspn.p	strtod.p	\
strtok.p      strtol.p      swab.p        tell.p	tfind.p		\
tolower.p     toupper.p     tsearch.p     ttyname.p	\
ttyslot.p 

DEPENDLIST = a64l.c \
	abort.c \
	abs.c \
	assert.c \
	atof.c \
	atoi.c \
	atol.c \
	biglitpow.c \
	bsearch.c \
	calloc.c \
	clock.c \
	crypt.c \
	ctdata.c \
	ctime.c \
	ctype.c \
	cuexit.c \
	dial.c \
	drand48.c \
	dtop.c \
	ecvt.c \
	errlst.c \
	execvp.c \
	fakcu.c \
	ftok.c \
	ftw.c \
	gcvt.c \
	getcwd.c \
	getenv.c \
	getgrent.c \
	getgrgid.c \
	getgrnam.c \
	getlogin.c \
	getopt.c \
	getpw.c \
	getpwent.c \
	getpwnam.c \
	getpwuid.c \
	getut.c \
	hsearch.c \
	isatty.c \
	l3.c \
	l64a.c \
	ldexp.c \
	lfind.c \
	lsearch.c \
	ltostr.c \
	malloc.c \
	memccpy.c \
	memchr.c \
	memcmp.c \
	memcpy.c \
	memset.c \
	mktemp.c \
	modf.c \
	mon.c \
	nlist.c \
	perror.c \
	ptod.c \
	putpwent.c \
	putenv.c \
	qsort.c \
	rand.c \
	sleep.c \
	ssignal.c \
	strcat.c \
	strchr.c \
	strcmp.c \
	strcpy.c \
	strcspn.c \
	strlen.c \
	strncat.c \
	strncmp.c \
	strncpy.c \
	strpbrk.c \
	strrchr.c \
	strspn.c \
	strtod.c \
	strtok.c \
	strtol.c \
	swab.c \
	tell.c \
	tfind.c \
	tolower.c \
	toupper.c \
	tsearch.c \
	ttyname.c \
	ttyslot.c

all: Makeincludes $(OBJECTS)

Makeincludes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes
	$(MAKE)

includes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes

prof: $(POBJECTS)

clean clobber:
	rm -fr *.[po]

install:

populate:
	getunit

#
# dependencies back into /usr/include or it's surrogate
#

include Makeincludes
include $(MAKEINC)/Makepost.h

#
# explicit conversion rules
#
.c.o:
	@echo $(@F):
	$(CC) $(CFLAGS) -c $(*F).c

.c.p:
	@echo $(@F):
	$(CC) $(CFLAGS) -S -c -p $(*F).c
	$(AS) -o $(*F).p $(*F).s
	@rm $(*F).s
