Home | History | Annotate | Line # | Download | only in sysinst
Makefile.inc revision 1.9.14.1
      1  1.9.14.1  pgoyette #	$NetBSD: Makefile.inc,v 1.9.14.1 2018/09/06 06:56:51 pgoyette Exp $
      2       1.1  dholland #
      3       1.1  dholland # Makefile for sysinst
      4       1.1  dholland 
      5       1.2  dholland .if exists(${.CURDIR}/../../../Makefile.inc)
      6       1.2  dholland .include "${.CURDIR}/../../../Makefile.inc"
      7       1.2  dholland .endif
      8       1.2  dholland 
      9       1.1  dholland PROG=		sysinst
     10       1.1  dholland NOMAN=		# defined
     11       1.1  dholland 
     12       1.1  dholland WARNS=		4
     13       1.1  dholland 
     14       1.1  dholland SRCS+=	menu_defs.c msg_defs.c main.c install.c upgrade.c \
     15       1.1  dholland 	txtwalk.c run.c factor.c net.c disks.c disks_lfs.c util.c geom.c \
     16       1.3    martin 	label.c target.c md.c sizemultname.c configmenu.c checkrc.c partman.c
     17       1.1  dholland 
     18       1.1  dholland SRCS+=	${MD_OPTIONS:MAOUT2ELF:S/AOUT2ELF/aout2elf.c/}
     19       1.1  dholland SRCS+=	${MENUS_MD:Mmenus.mbr:S/menus.mbr/mbr.c/}
     20       1.1  dholland SRCS+=	${CPPFLAGS:M-DWSKBD:S/-DWSKBD/wskbd.c/}
     21       1.1  dholland SRCS+=	${NODISKLABEL:D:Ubsddisklabel.c savenewlabel.c}
     22       1.1  dholland 
     23       1.1  dholland DPSRCS+= defs.h
     24       1.1  dholland 
     25       1.1  dholland SYSINSTLANG?=	en
     26       1.1  dholland LANGUAGES?=	de en es fr pl
     27       1.1  dholland 
     28       1.1  dholland MSG_MD?=	msg.md.${SYSINSTLANG}
     29       1.1  dholland MENUS_MD?=	menus.md.${SYSINSTLANG}
     30       1.1  dholland 
     31       1.1  dholland .include <bsd.own.mk>		# for mk.conf
     32       1.2  dholland #.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
     33       1.2  dholland 
     34       1.2  dholland DISTRIBVER!=	${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
     35       1.2  dholland DISTRIBVERDEP=	${NETBSDSRCDIR}/sys/sys/param.h \
     36       1.2  dholland 		${NETBSDSRCDIR}/sys/conf/osrelease.sh
     37       1.1  dholland 
     38       1.1  dholland _MKSHTARGET_CREATE?=	${_MKSHMSG_CREATE} ${.CURDIR:T}/${.TARGET}
     39       1.1  dholland 
     40       1.1  dholland DPADD=		${LIBCURSES} ${LIBTERMLIB} ${LIBUTIL}
     41       1.1  dholland LDADD=		-lcurses -ltermlib -lutil
     42       1.1  dholland 
     43       1.1  dholland UNIF_AWK=	${.CURDIR}/../../unif.awk
     44       1.1  dholland MSG_XLAT_SH=	${.CURDIR}/../../msg_xlat.sh
     45       1.1  dholland 
     46  1.9.14.1  pgoyette 
     47       1.4    martin CATALOGDIR=	/usr/share/sysinst/catalog
     48       1.1  dholland CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.CURDIR} \
     49       1.1  dholland 		-DREL=\"${DISTRIBVER}\" -DMACH=\"${MACHINE}\" \
     50       1.3    martin 		-DMACH_${MACHINE} -DARCH_${MACHINE_ARCH} \
     51       1.8    martin 		${NODISKLABEL:D-DNO_DISKLABEL}
     52       1.8    martin 
     53  1.9.14.1  pgoyette .if (defined(BUILDID))
     54  1.9.14.1  pgoyette COPTS+=	-DBUILDID=\"${BUILDID}\"
     55  1.9.14.1  pgoyette .endif
     56  1.9.14.1  pgoyette .if defined(NETBSD_OFFICIAL_RELEASE) && ${NETBSD_OFFICIAL_RELEASE} == "yes"
     57  1.9.14.1  pgoyette CPPFLAGS+= -DSYSINST_FTP_HOST=\"ftp.NetBSD.org\" -DNETBSD_OFFICIAL_RELEASE
     58  1.9.14.1  pgoyette CPPFLAGS+= -DSYSINST_HTTP_HOST=\"cdn.NetBSD.org\" -DNETBSD_OFFICIAL_RELEASE
     59  1.9.14.1  pgoyette .else
     60  1.9.14.1  pgoyette CPPFLAGS+= -DSYSINST_FTP_HOST=\"nyftp.NetBSD.org\"
     61  1.9.14.1  pgoyette CPPFLAGS+= -DSYSINST_HTTP_HOST=\"nycdn.NetBSD.org\"
     62  1.9.14.1  pgoyette .if (${DISTRIBVER:M*.99.*})
     63  1.9.14.1  pgoyette CPPFLAGS+= -DREL_PATH=\"HEAD\"
     64  1.9.14.1  pgoyette .elif (${DISTRIBVER:M*.[0-9].[0-9]*})
     65  1.9.14.1  pgoyette CPPFLAGS+= -DREL_PATH=\"netbsd-${DISTRIBVER:C/\.[0-9][_A-Z]*$//:S/./-/}\"
     66  1.9.14.1  pgoyette .elif (${DISTRIBVER:M*.[0-9]*})
     67  1.9.14.1  pgoyette CPPFLAGS+= -DREL_PATH=\"netbsd-${DISTRIBVER:C/\.[0-9][_A-Z]*$//}\"
     68  1.9.14.1  pgoyette .endif
     69  1.9.14.1  pgoyette .endif
     70  1.9.14.1  pgoyette 
     71       1.8    martin .if !defined(DEBUG)
     72       1.8    martin CPPFLAGS+=	-DCATALOG_DIR=\"${CATALOGDIR}\"
     73       1.8    martin .endif
     74       1.3    martin 
     75       1.3    martin .if (defined(DEBUG))
     76       1.6    martin .if ${ACTIVE_CC} == "gcc"
     77       1.6    martin # make gcc run additional passes for better debug info (only needed
     78       1.6    martin # when compiling with -O0)
     79       1.6    martin O0TRACKING=	-fvar-tracking-assignments -fvar-tracking
     80       1.6    martin .endif
     81       1.7    martin CPPFLAGS+=-DDEBUG
     82       1.7    martin DBG +=-g -O0 ${O0TRACKING}
     83       1.7    martin .endif
     84       1.7    martin 
     85       1.7    martin .if empty(DBG:M-g)
     86       1.7    martin COPTS += -Os
     87       1.3    martin .endif
     88       1.1  dholland 
     89       1.1  dholland .if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
     90       1.1  dholland CPPFLAGS+=-DINET6
     91       1.1  dholland .endif
     92       1.1  dholland 
     93       1.1  dholland .if defined(HAVE_GCC) || defined(HAVE_PCC)
     94       1.1  dholland COPTS.label.c+=	-Wno-pointer-sign
     95       1.1  dholland .endif
     96       1.1  dholland COPTS.main.c += -Wno-format-nonliteral
     97       1.1  dholland COPTS.disks.c += -Wno-format-nonliteral
     98       1.1  dholland COPTS.util.c += -Wno-format-nonliteral
     99       1.1  dholland COPTS.label.c += -Wno-format-nonliteral
    100       1.1  dholland COPTS.target.c += -Wno-format-nonliteral
    101       1.1  dholland COPTS.mbr.c += -Wno-format-nonliteral
    102       1.1  dholland COPTS.msg_defs.c += -Wno-format-nonliteral
    103       1.1  dholland COPTS.bsddisklabel.c += -Wno-format-nonliteral
    104       1.1  dholland COPTS.md.c += -Wno-format-nonliteral
    105       1.9  christos COPTS.partman.c += -Wno-format-nonliteral -Wno-stack-protector
    106       1.1  dholland 
    107       1.1  dholland # Host to ftp from.  Default:
    108       1.1  dholland #	"ftp.NetBSD.org"
    109       1.1  dholland #
    110       1.1  dholland .if defined(SYSINST_FTP_HOST)
    111       1.1  dholland CPPFLAGS+=	-DSYSINST_FTP_HOST=\"${SYSINST_FTP_HOST}\"
    112       1.1  dholland .endif
    113       1.1  dholland 
    114       1.1  dholland # Top-level ftp directory.  Default:
    115       1.1  dholland #	"pub/NetBSD/NetBSD-" + VER + "/" + MACH
    116       1.1  dholland #
    117       1.1  dholland .if defined(SYSINST_FTP_DIR)
    118       1.1  dholland CPPFLAGS+=	-DSYSINST_FTP_DIR=\"${SYSINST_FTP_DIR}\"
    119       1.1  dholland .endif
    120       1.1  dholland 
    121       1.1  dholland # Top-level CDROM directory.  Default:
    122       1.1  dholland #	"/" + MACH
    123       1.1  dholland #
    124       1.1  dholland .if defined(SYSINST_CDROM_DIR)
    125       1.1  dholland CPPFLAGS+=	-DSYSINST_CDROM_DIR=\"${SYSINST_CDROM_DIR}\"
    126       1.1  dholland .endif
    127       1.1  dholland 
    128       1.1  dholland 
    129       1.1  dholland DPSRCS+=	msg_defs.h menu_defs.h
    130       1.1  dholland 
    131       1.1  dholland CLEANFILES=	menu_defs.c menu_defs.h menus.def \
    132       1.1  dholland 		msg_defs.c msg_defs.h msg.def msgtouch \
    133       1.1  dholland 		sysinstmsgs.*
    134       1.1  dholland 
    135       1.1  dholland .PATH: ${.CURDIR}/../..
    136       1.1  dholland 
    137       1.1  dholland menu_defs.h: menu_defs.c
    138       1.1  dholland 	[ -f ${.TARGET} ] || { \
    139       1.1  dholland 		${_MKSHTARGET_CREATE}; \
    140       1.1  dholland 		${TOOL_MENUC} menus.def; \
    141       1.1  dholland 	}
    142       1.1  dholland menu_defs.c: menus.def
    143       1.1  dholland 	${_MKTARGET_CREATE}
    144       1.1  dholland 	[ ! -f menu_defs.h ] || mv -f menu_defs.h menu_defs.oh
    145       1.1  dholland 	${TOOL_MENUC} menus.def
    146       1.1  dholland 	! cmp -s menu_defs.oh menu_defs.h || mv -f menu_defs.oh menu_defs.h
    147       1.1  dholland 	@rm -f menu_defs.oh
    148       1.1  dholland 
    149       1.1  dholland msg_defs.h: msg_defs.c
    150       1.1  dholland 	[ -f ${.TARGET} ] || { \
    151       1.1  dholland 		${_MKSHTARGET_CREATE}; \
    152       1.1  dholland 		${TOOL_MSGC} msg.def; \
    153       1.1  dholland 	}
    154       1.1  dholland msg_defs.c: msg.def
    155       1.1  dholland 	${_MKTARGET_CREATE}
    156       1.1  dholland 	[ ! -f msg_defs.h ] || mv -f msg_defs.h msg_defs.oh
    157       1.1  dholland 	${TOOL_MSGC} msg.def
    158       1.1  dholland 	! cmp -s msg_defs.oh msg_defs.h || mv -f msg_defs.oh msg_defs.h
    159       1.1  dholland 	@rm -f msg_defs.oh
    160       1.1  dholland 
    161       1.1  dholland # Needed to get proper dependency checks on osrelease
    162       1.1  dholland msgtouch: ${DISTRIBVERDEP}
    163       1.1  dholland 	touch ${.TARGET}
    164       1.1  dholland 
    165       1.1  dholland msg.def: msg.mi.${SYSINSTLANG} ${MSG_MD} msgtouch
    166       1.1  dholland 	${_MKTARGET_CREATE}
    167       1.1  dholland 	${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC} | \
    168       1.1  dholland 	${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
    169       1.1  dholland 	${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" > ${.TARGET}
    170       1.1  dholland 
    171       1.1  dholland menus.def: menus.mi ${MENUS_MD} msgtouch
    172       1.1  dholland 	${_MKTARGET_CREATE}
    173       1.1  dholland 	${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC} | \
    174       1.1  dholland 	${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
    175       1.1  dholland 	${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" > ${.TARGET}
    176       1.1  dholland 
    177       1.1  dholland sysinstmsgs.fmtcnt: msg.mi.${SYSINSTLANG} ${MSG_MD} msgtouch msg_defs.h
    178       1.1  dholland 	${_MKTARGET_CREATE}
    179       1.1  dholland 	${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" \
    180       1.1  dholland 		${.ALLSRC:M*.${SYSINSTLANG}} | \
    181       1.1  dholland 	${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
    182       1.1  dholland 	${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" | \
    183       1.1  dholland 	${HOST_SH} ${MSG_XLAT_SH} -c > ${.TARGET}
    184       1.1  dholland 
    185       1.1  dholland .for LANG in ${LANGUAGES:N${SYSINSTLANG}}
    186       1.1  dholland sysinstmsgs.${LANG}: msg.mi.${LANG} ${MSG_MD:S/.${SYSINSTLANG}$/.${LANG}/} msgtouch msg_defs.h sysinstmsgs.fmtcnt
    187       1.1  dholland 	${_MKTARGET_CREATE}
    188       1.1  dholland 	${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC:M*.${LANG}} | \
    189       1.1  dholland 	${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
    190       1.1  dholland 	${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" | \
    191       1.1  dholland 	${HOST_SH} ${MSG_XLAT_SH} -f sysinstmsgs.fmtcnt > ${.TARGET}
    192       1.1  dholland 
    193       1.1  dholland DPSRCS+=	sysinstmsgs.${LANG}
    194       1.5    martin # FILES+=		sysinstmsgs.${LANG}
    195       1.5    martin # FILESDIR_sysinstmsgs.${LANG}=	${CATALOGDIR}
    196       1.1  dholland .endfor
    197       1.1  dholland 
    198       1.1  dholland .include <bsd.prog.mk>
    199