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