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