]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - usr.sbin/sysinstall/Makefile
MFC r308437 and r308461:
[FreeBSD/stable/8.git] / usr.sbin / sysinstall / Makefile
1 # $FreeBSD$
2
3 .if ${MACHINE_ARCH} != "ia64"
4 _wizard=        wizard.c
5 .endif
6
7 PROG=   sysinstall
8 MAN=    sysinstall.8
9 SRCS=   anonFTP.c cdrom.c command.c config.c devices.c dhcp.c \
10         disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \
11         ftp.c globals.c http.c httpdirect.c index.c install.c \
12         installUpgrade.c keymap.c label.c main.c makedevs.c media.c menus.c \
13         misc.c modules.c mouse.c msg.c network.c nfs.c options.c package.c \
14         system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \
15         variable.c ${_wizard} keymap.h countries.h
16
17 CFLAGS+= -DUSE_GZIP=1
18 .if ${MACHINE} == "pc98"
19 CFLAGS+= -DPC98
20 .endif
21 CFLAGS+= -I${.CURDIR}/../../gnu/lib/libdialog -I.
22
23 DPADD=  ${LIBDIALOG} ${LIBNCURSES} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO}
24 LDADD=  -ldialog -lncurses -lutil -ldisk -lftpio
25
26 #
27 # When distributions have both UP and SMP kernels sysinstall
28 # will probe for the number of cpus on the target machine and
29 # automatically select which is appropriate.  This can be overridden
30 # through the menus or both kernels can be installed (with the
31 # most "appropriate" one setup as /boot/kernel).  For now this
32 # is done for i386 and amd64; for other systems support must be
33 # added to identify the cpu count if acpi and MPTable probing
34 # is insufficient.
35 #
36 # The unmber of cpus probed is passed through the environment in
37 # VAR_NCPUS ("ncpus") to scripts.
38 #
39 # Note that WITH_SMP is a compile time option that enables the
40 # builtin menus for the SMP kernel configuration.  If this kernel
41 # is not built (see release/Makefile) then this should not be
42 # enabled as sysinstall may try to select an SMP kernel config
43 # where none is available.  This option should not be needed--we
44 # should probe for an SMP kernel in the distribution but doing
45 # that is painful because of media changes and the structure of
46 # sysinstall so for now it's a priori.
47 #
48 .if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "amd64"
49 SRCS+=  acpi.c biosmptable.c
50 .if exists(${.CURDIR}/../../sys/${MACHINE}/conf/SMP)
51 CFLAGS+=-DWITH_SMP      
52 .endif
53 DPADD+= ${LIBDEVINFO}
54 LDADD+= -ldevinfo
55 .endif
56
57 CLEANFILES=     makedevs.c rtermcap
58 CLEANFILES+=    keymap.tmp keymap.h countries.tmp countries.h
59
60 .if exists(${.CURDIR}/../../share/termcap/termcap.src)
61 RTERMCAP=       TERMCAP=${.CURDIR}/../../share/termcap/termcap.src ./rtermcap
62 .else
63 RTERMCAP=       ./rtermcap
64 .endif
65
66 makedevs.c:     Makefile rtermcap
67         echo '#include <sys/types.h>' > makedevs.c
68         ${RTERMCAP} ansi | \
69                 file2c 'const char termcap_ansi[] = {' ',0};' \
70                 >> makedevs.c
71         ${RTERMCAP} cons25w | \
72                 file2c 'const char termcap_cons25w[] = {' ',0};' \
73                 >> makedevs.c
74         ${RTERMCAP} cons25 | \
75                 file2c 'const char termcap_cons25[] = {' ',0};' \
76                 >> makedevs.c
77         ${RTERMCAP} cons25-m | \
78                 file2c 'const char termcap_cons25_m[] = {' ',0};' \
79                 >> makedevs.c
80         ${RTERMCAP} cons25r | \
81                 file2c 'const char termcap_cons25r[] = {' ',0};' \
82                 >> makedevs.c
83         ${RTERMCAP} cons25r-m | \
84                 file2c 'const char termcap_cons25r_m[] = {' ',0};' \
85                 >> makedevs.c
86         ${RTERMCAP} cons25l1 | \
87                 file2c 'const char termcap_cons25l1[] = {' ',0};' \
88                 >> makedevs.c
89         ${RTERMCAP} cons25l1-m | \
90                 file2c 'const char termcap_cons25l1_m[] = {' ',0};' \
91                 >> makedevs.c
92         ${RTERMCAP} vt100 | \
93                 file2c 'const char termcap_vt100[] = {' ',0};' \
94                 >> makedevs.c
95         ${RTERMCAP} xterm | \
96                 file2c 'const char termcap_xterm[] = {' ',0};' \
97                 >> makedevs.c
98
99 build-tools:    rtermcap
100
101 rtermcap:       rtermcap.c
102         ${CC} -o ${.TARGET} ${.ALLSRC} -ltermcap
103
104 .if ${MACHINE} == "pc98"
105 KEYMAPS= jp.pc98 jp.pc98.iso
106 .else
107 KEYMAPS= be.iso bg.bds.ctrlcaps bg.phonetic.ctrlcaps br275.iso \
108         ce.iso2 cs.latin2.qwertz danish.iso el.iso07 \
109         estonian.cp850 estonian.iso estonian.iso15 finnish.iso fr.iso \
110         german.iso gr.elot.acc gr.us101.acc  hr.iso hu.iso2.101keys \
111         it.iso icelandic.iso jp.106 latinamerican latinamerican.iso.acc \
112         norwegian.iso pl_PL.ISO8859-2 \
113         pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso spanish.iso.acc swedish.iso \
114         swissfrench.iso \
115         swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \
116         us.iso us.pc-ctrl us.unix
117 .endif
118
119 keymap.h:
120         rm -f keymap.tmp
121         for map in ${KEYMAPS} ; do \
122                 KEYMAP_PATH=${.CURDIR}/../../share/syscons/keymaps \
123                         kbdcontrol -L $$map | \
124                         sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \
125         done
126         echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp
127         for map in ${KEYMAPS} ; do \
128                 echo -n '       { "'$$map'", ' >> keymap.tmp ; \
129                 echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \
130         done
131         ( echo "        { NULL, NULL }"; echo "};" ; echo "" ) >> keymap.tmp
132         mv keymap.tmp keymap.h
133
134 countries.h: ${.CURDIR}/../../share/misc/iso3166
135         rm -f countries.tmp
136         awk 'BEGIN { \
137             FS = "\t"; \
138             num = 1; \
139             print "DMenu MenuCountry = {"; \
140             print "    DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,"; \
141             print "    \"Country Selection\","; \
142             print "    \"Please choose a country, region, or group.\\n\""; \
143             print "    \"Select an item using [SPACE] or [ENTER].\","; \
144             printf "    NULL,\n    NULL,\n    { "; \
145         } \
146         /^[[:space:]]*#/ {next;} \
147         {if (num > 1) {printf "      ";} \
148             print "{ \"" num "\", \"" $$4 "\"" \
149             ", dmenuVarCheck, dmenuSetCountryVariable" \
150             ", NULL, VAR_COUNTRY \"=" tolower($$1) "\" },"; \
151             ++num;} \
152         END {print "      { NULL } }\n};\n";}' < ${.ALLSRC} > countries.tmp
153         mv countries.tmp ${.TARGET}
154
155 .include <bsd.prog.mk>