1 # $NetBSD: Makefile.inc,v 1.48 2009/08/23 20:58:05 jmcneill Exp $
12 SRCS+= menu_defs.c msg_defs.c main.c install.c upgrade.c \
13 txtwalk.c run.c factor.c net.c disks.c disks_lfs.c util.c geom.c \
14 label.c target.c md.c sizemultname.c
16 SRCS+= ${MD_OPTIONS:MAOUT2ELF:S/AOUT2ELF/aout2elf.c/}
17 SRCS+= ${MENUS_MD:Mmenus.mbr:S/menus.mbr/mbr.c/}
18 SRCS+= ${CPPFLAGS:M-DWSKBD:S/-DWSKBD/wskbd.c/}
19 SRCS+= ${NODISKLABEL:D:Ubsddisklabel.c savenewlabel.c}
22 LANGUAGES?= de en es fr pl
24 MSG_MD?= msg.md.${SYSINSTLANG}
25 MENUS_MD?= menus.md.${SYSINSTLANG}
27 .include <bsd.own.mk> # for mk.conf
28 .include <bsd.sys.mk> # for HOST_SH, TOOL_*
29 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
31 _MKSHTARGET_CREATE?= ${_MKSHMSG_CREATE} ${.CURDIR:T}/${.TARGET}
33 DPADD= ${LIBCURSES} ${LIBTERMCAP} ${LIBUTIL}
34 LDADD= -lcurses -ltermcap -lutil
36 UNIF_AWK= ${.CURDIR}/../../unif.awk
37 MSG_XLAT_SH= ${.CURDIR}/../../msg_xlat.sh
39 CPPFLAGS+= -I. -I${.CURDIR}/../.. -I${.CURDIR} \
40 -DREL=\"${DISTRIBVER}\" -DMACH=\"${MACHINE}\"
42 .if defined(SMALLPROG_INET6) && (${USE_INET6} != "no")
46 .if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)
47 COPTS.label.c+= -Wno-pointer-sign
50 # Host to ftp from. Default:
53 .if defined(SYSINST_FTP_HOST)
54 CPPFLAGS+= -DSYSINST_FTP_HOST=\"${SYSINST_FTP_HOST}\"
57 # Top-level ftp directory. Default:
58 # "pub/NetBSD/NetBSD-" + VER + "/" + MACH
60 .if defined(SYSINST_FTP_DIR)
61 CPPFLAGS+= -DSYSINST_FTP_DIR=\"${SYSINST_FTP_DIR}\"
64 # Top-level CDROM directory. Default:
67 .if defined(SYSINST_CDROM_DIR)
68 CPPFLAGS+= -DSYSINST_CDROM_DIR=\"${SYSINST_CDROM_DIR}\"
72 DPSRCS+= msg_defs.h menu_defs.h
74 CLEANFILES= menu_defs.c menu_defs.h menus.def \
75 msg_defs.c msg_defs.h msg.def msgtouch \
78 .PATH: ${.CURDIR}/../..
80 menu_defs.h: menu_defs.c
81 [ -f ${.TARGET} ] || { \
82 ${_MKSHTARGET_CREATE}; \
83 ${TOOL_MENUC} menus.def; \
85 menu_defs.c: menus.def
87 [ ! -f menu_defs.h ] || mv -f menu_defs.h menu_defs.oh
88 ${TOOL_MENUC} menus.def
89 ! cmp -s menu_defs.oh menu_defs.h || mv -f menu_defs.oh menu_defs.h
92 msg_defs.h: msg_defs.c
93 [ -f ${.TARGET} ] || { \
94 ${_MKSHTARGET_CREATE}; \
95 ${TOOL_MSGC} msg.def; \
99 [ ! -f msg_defs.h ] || mv -f msg_defs.h msg_defs.oh
101 ! cmp -s msg_defs.oh msg_defs.h || mv -f msg_defs.oh msg_defs.h
104 # Needed to get proper dependency checks on osrelease
105 msgtouch: ${DISTRIBVERDEP}
108 msg.def: msg.mi.${SYSINSTLANG} ${MSG_MD} msgtouch
110 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC} | \
111 ${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
112 ${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" > ${.TARGET}
114 menus.def: menus.mi ${MENUS_MD} msgtouch
116 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC} | \
117 ${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
118 ${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" > ${.TARGET}
120 sysinstmsgs.fmtcnt: msg.mi.${SYSINSTLANG} ${MSG_MD} msgtouch msg_defs.h
122 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" \
123 ${.ALLSRC:M*.${SYSINSTLANG}} | \
124 ${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
125 ${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" | \
126 ${HOST_SH} ${MSG_XLAT_SH} -c > ${.TARGET}
128 .for LANG in ${LANGUAGES:N${SYSINSTLANG}}
129 sysinstmsgs.${LANG}: msg.mi.${LANG} ${MSG_MD:S/.${SYSINSTLANG}$/.${LANG}/} msgtouch msg_defs.h sysinstmsgs.fmtcnt
131 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" ${.ALLSRC:M*.${LANG}} | \
132 ${TOOL_SED} "s/@@MACHINE@@/${MACHINE}/" | \
133 ${TOOL_AWK} -f ${UNIF_AWK} -v defines="${MD_OPTIONS}" | \
134 ${HOST_SH} ${MSG_XLAT_SH} -f sysinstmsgs.fmtcnt > ${.TARGET}
136 DPSRCS+= sysinstmsgs.${LANG}
139 .include <bsd.prog.mk>