`# $Id: Makefile.host,v 4.43 2012/07/16 21:46:30 ksb Exp $ # platform recipe for maketd, msrc 2008 # Kevin Braunsdorf Purdue University Computing Center 'changequote([,])dnl [Q=' O=` ]changequote(`,')dnl `BIN= ${DESTDIR}/usr/local/bin DOC= ${DESTDIR}/usr/local/man/man1 SHELL=/bin/sh PROG= maketd # Most compile time options have been moved to machine.h # We might need the old style script to make our first depends! # Use either of these lines, upper might be faster if your cc has -M # (the second line goes to great trouble to get a # sign, some # makes are very broken!) #OLDCODE= ${CC} ${CFLAGS} -M $$file |sed -e ${Q}s/^.*\.o *: *//${Q} OLDCODE= ${CC} ${CFLAGS} -E $$file |\ sed -n -e ${O}echo ${Q}/^@pragma/d${Q} |tr "@" "\043"${O} -e /mkcmd_generated/d |\ sed -n -e ${O}echo ${Q}/^@/p${Q} |tr "@" "\043"${O} |\ sed -e ${Q}s/^.[ 0-9]*"\(.*\)" *$$/\1/${Q} -e ${Q}/\/usr\/include/d${Q} I=/usr/include S=/usr/include/sys P= G=/usr/local/lib/gcc-lib INCLUDE= DEBUG='ifelse(HOSTTYPE,`V386',`',`-O')` CDEFS= -D'HOSTTYPE`'ifelse( 1,ifdef(`PATH_CPP',1,0),` `-DPATH_CPP="\"'PATH_CPP`\""'', HOSTTYPE,`SUN5',` -DPATH_CPP="\"`eval' \$${CC-${Q}cc -xM${Q}} ${Q}%I %F${Q}\""', HOSTTYPE,`VAX8800',` -DUSE_CPP_M=0', HOSTTYPE,`IBMR2',` -DUSE_CPP_M=0', HOSTTYPE,`TITAN',` -DUSE_CPP_M=0', HOSTTYPE,`ETA10',` -DSYSV -DNEED_STRCMP -DUSE_CPP_M=0', HOSTTYPE,`V386',` -DSYSV -DNEED_STRCMP -DUSE_CPP_M=0', HOSTTYPE,`EPIX',` -DSYSV -DNEED_STRCMP -DUSE_CPP_M=0')` CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE} GENh= HDR= 'ifelse(MKCMD,`no',`main.h ')`abrv.h maketd.h machine.h SRC= 'ifelse(MKCMD,`no',`main.c ')`abrv.c maketd.c GENH= 'ifelse(MKCMD,`no',`',`main.h')` srtunq.h GENC= 'ifelse(MKCMD,`no',`',`main.c')` srtunqfree.c srtunqgets.c \ srtunqgti.c srtunqin.c srtunqinit.c srtunqdtree.c GEN= ${GENC} ${GENH} DEP= ${GENC} ${SRC} OBJ= main.o abrv.o maketd.o srtunqfree.o srtunqgets.o \ srtunqgti.o srtunqin.o srtunqinit.o srtunqdtree.o MAN= maketd.man OTHER= README GCC.awk M4.patch TODO maketd.m SOURCE= Makefile ITO.spec ${OTHER} ${MAN} ${HDR} ${SRC} CC='ifelse(HOSTTYPE,`HPUX11',`gcc', `cc')` 'ifelse(HOSTTYPE,`NEXT2',`.SUFFIXES: .SUFFIXES: .c .h .o .s')` all: ${PROG} ${PROG}:$P ${OBJ} ${CC} -o $@ ${DEBUG} ${OBJ} 'ifelse(MKCMD,`no',`', `main.h: main.c main.c: maketd.m mkcmd std_help.m std_version.m maketd.m -(cmp -s prog.c main.c || (mv prog.c main.c && echo main.c updated)) -(cmp -s prog.h main.h || (mv prog.h main.h && echo main.h updated)) rm -rf prog.[ch] ')` # there is no way to make this work without explode, really. -- ksb srtunq.h: explode -s $@ srtunqfree.c srtunqgets.c srtunqgti.c srtunqin.c srtunqinit.c srtunqdtree.c: MACHINE_H="#include \"machine.h\"" explode -u ${O}expr $@ : ${Q}srtunq\(.*\)\.c${Q}${O} srtunq.c clean: FRC rm -f Makefile.bak ${PROG} ${GEN} *.o a.out core errs lint.errs tags # we use the old sloppy code for booting our depends depend: ${HDR} ${SRC} ${GEN} FRC mv Makefile Makefile.bak sed ${Q}/^# DO NOT DELETE THIS LINE/,$$d${Q} Makefile echo ${Q}# DO NOT DELETE THIS LINE - maketd DEPENDS ON IT${Q} >>Makefile echo ${Q}${Q} >>Makefile for file in ${DEP}; do \ o=${O}echo $$file |sed ${Q}s/c$$/o/${Q}${O} ;\ ${OLDCODE} |sort -u |\ awk ${Q}BEGIN { rec = "${Q}$${o}${Q}" ": " ; } \ { if (length(rec $$1) > 76) \ { print rec, "\\" ; rec = " " $$1 } \ else { rec = rec " " $$1 } } \ END { print rec, "\n" } ${Q} >>Makefile ;\ done echo ${Q}# *** Do not add anything here - It will go away. ***${Q} >>Makefile depend2: ${HDR} ${SRC} ${GEN} FRC all ./${PROG} -d ${INCLUDE} ${DEP} distrib: FRC distrib -c ${BIN}/${PROG} install: all dirs FRC install -c -s ${PROG} ${BIN}/${PROG} lint: ${HDR} ${SRC} ${GEN} FRC lint -h ${CDEFS} ${INCLUDE} ${DEP} mkcat: ${MAN} mkcat ${MAN} print: source FRC lpr -p -Pstaff -J"Maketd Source" ${SOURCE} shar: source FRC shar ${SOURCE} dirs: ${BIN} ${DOC} ${BIN} ${DOC}: install -dr $@ source: ${SOURCE} spotless: clean rcsclean ${SOURCE} tags: ${SRC} ${HDR} ${GEN} ctags -t ${SRC} ${HDR} ${GEN} ${SOURCE}: co -q $@ FRC: # DO NOT DELETE THIS LINE - maketd DEPENDS ON IT abrv.o: abrv.c abrv.h machine.h main.h maketd.h srtunq.h main.o: abrv.h machine.h main.c maketd.h srtunq.h maketd.o: abrv.h machine.h main.h maketd.c maketd.h srtunq.h srtunqdtree.o: srtunq.h srtunqdtree.c srtunqfree.o: srtunq.h srtunqfree.c srtunqgets.o: srtunq.h srtunqgets.c srtunqgti.o: srtunq.h srtunqgti.c srtunqin.o: srtunq.h srtunqin.c srtunqinit.o: srtunq.h srtunqinit.c # *** Do not add anything here - It will go away. *** 'dnl