`# $Id: Makefile.host,v 1.10 2012/09/03 19:10:59 ksb Exp $ # master Makefile for efmd, msrc 2008 PROG= efmd BIN= ${DESTDIR}/usr/local/sbin EXPDIR= ${DESTDIR}/usr/local/lib/explode APIDIR= ${DESTDIR}/usr/local/lib/mkcmd/api DOC= ${DESTDIR}/usr/local/man/man8 I=/usr/include S=/usr/include/sys L=/usr/include/local P= INCLUDE= DEBUG= CDEFS= -D'HOSTTYPE` CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE} 'ifelse(HOSTTYPE,`HPUX9',`CC=gcc', HOSTTYPE,`HPUX10',`CC=gcc', HOSTTYPE,`HPUX11',`CC=gcc', `')` GENC= main.c mkdtemp.c GENH= main.h GEN= ${GENC} ${GENH} slot.m evector.m hostdb.m HDR= machine.h SRC= DEP= ${GENC} ${LINKC} ${SRC} OBJ= main.o 'ifelse(HOSTTYPE,SUN5,` mkdtemp.o', HOSTTYPE,HPUX9,` mkdtemp.o', HOSTTYPE,HPUX10,` mkdtemp.o', HOSTTYPE,HPUX11,` mkdtemp.o', HOSTTYPE,AIX,` mkdtemp.o', HOSTTYPE,IBMR2,` mkdtemp.o')` MAN= efmd.man OTHER= efmd.m efmd.html ereg.ksh SOURCE= Makefile ITO.spec ${OTHER} ${MAN} ${HDR} ${SRC} all: ${PROG} ${PROG}:$P ${OBJ} ${CC} -o $@ ${CFLAGS} ${OBJ}'ifelse( HOSTTYPE,SUN5,` -lsocket -lnsl')` slot.m hostdb.m evector.m: explode -s $@ main.h: main.c # Transitional code while we change from exploding the mkcmd files # to getting them from the mkcmd/api directory. --ksb main.c: ${PROG}.m -API="";\ if [ -f ${APIDIR}/evector.m ]; then API="$${API} api_evector.m"; else make evector.m; API="$${API} evector.m"; fi;\ if [ -f ${APIDIR}/hostdb.m ]; then API="$${API} api_hostdb.m"; else make hostdb.m; API="$${API} hostdb.m"; fi;\ if [ -f ${APIDIR}/slot.m ]; then API="$${API} api_slot.m"; else make slot.m; API="$${API} slot.m"; fi;\ mkcmd ${PROG}.m'ifelse(HOSTTYPE,SUN5,` util_fgetln.m', HOSTTYPE,HPUX9,` util_fgetln.m', HOSTTYPE,HPUX10,` util_fgetln.m', HOSTTYPE,HPUX11,` util_fgetln.m', HOSTTYPE,AIX,` util_fgetln.m', HOSTTYPE,IBMR2,` util_fgetln.m', HOSTTYPE,LINUX,` util_fgetln.m')` $${API} -(cmp -s prog.c main.c || (cp prog.c main.c && echo main.c updated)) -(cmp -s prog.h main.h || (cp prog.h main.h && echo main.h updated)) rm -f prog.[ch] mkdtemp.c: explode -u dtemp mk.c boot: all dirs FRC install -c ${PROG} ${BIN}/${PROG} clean: FRC rm -f Makefile.bak ${PROG} ${GEN} ${LINK} *.o a.out core errs lint.out tags calls: ${SRC} ${HDR} ${GEN} FRC calls ${CDEFS} ${INCLUDE} ${DEP} deinstall: ${MAN} ${DOC} ${BIN} ${EXPDIR} FRC -install -R ${BIN}/${PROG} mkcat -r${DOC} -D ${MAN} depend: ${SRC} ${HDR} ${GEN} ${LINK} FRC maketd ${CDEFS} ${INCLUDE} ${DEP} dirs: ${BIN} ${DOC} install: all dirs FRC install -cs ${PROG} ${BIN}/${PROG} lint: ${SRC} ${HDR} ${GEN} FRC lint -h ${CDEFS} ${INCLUDE} ${DEP} mkcat: ${MAN} ${DOC} FRC mkcat -r${DOC} ${MAN} print: source FRC txt2ps -m 0.65 -n -PHxmd -l68 -w88 efmd.m | lpr source: ${SOURCE} spotless: clean rcsclean ${SOURCE} tags: ${HDR} ${SRC} ${GEN} ctags -t ${HDR} ${SRC} ${GEN} ${BIN} ${DOC}: install -dr $@ ${SOURCE}: co -q $@ FRC: # DO NOT DELETE THIS LINE - make depend DEPENDS ON IT main.o: main.c main.h machine.h mkdtemp.o: mkdtemp.c # *** Do not add anything here - It will go away. *** 'dnl