]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - usr.sbin/sysinstall/Makefile
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.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 index.c install.c installUpgrade.c keymap.c \
12         label.c main.c makedevs.c media.c menus.c misc.c modules.c \
13         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 norwegian.iso pl_PL.ISO8859-2 \
112         pt.iso ru.koi8-r si.iso sk.iso2 spanish.iso swedish.iso \
113         swissfrench.iso \
114         swissgerman.iso ua.koi8-u ua.koi8-u.shift.alt uk.iso us.dvorak \
115         us.iso us.pc-ctrl us.unix
116 .endif
117
118 keymap.h:
119         rm -f keymap.tmp
120         for map in ${KEYMAPS} ; do \
121                 KEYMAP_PATH=${.CURDIR}/../../share/syscons/keymaps \
122                         kbdcontrol -L $$map | \
123                         sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \
124         done
125         echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp
126         for map in ${KEYMAPS} ; do \
127                 echo -n '       { "'$$map'", ' >> keymap.tmp ; \
128                 echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \
129         done
130         ( echo "        { NULL, NULL }"; echo "};" ; echo "" ) >> keymap.tmp
131         mv keymap.tmp keymap.h
132
133 countries.h: ${.CURDIR}/../../share/misc/iso3166
134         rm -f countries.tmp
135         awk 'BEGIN { \
136             FS = "\t"; \
137             num = 1; \
138             print "DMenu MenuCountry = {"; \
139             print "    DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,"; \
140             print "    \"Country Selection\","; \
141             print "    \"Please choose a country, region, or group.\\n\""; \
142             print "    \"Select an item using [SPACE] or [ENTER].\","; \
143             printf "    NULL,\n    NULL,\n    { "; \
144         } \
145         /^[[:space:]]*#/ {next;} \
146         {if (num > 1) {printf "      ";} \
147             print "{ \"" num "\", \"" $$4 "\"" \
148             ", dmenuVarCheck, dmenuSetCountryVariable" \
149             ", NULL, VAR_COUNTRY \"=" tolower($$1) "\" },"; \
150             ++num;} \
151         END {print "      { NULL } }\n};\n";}' < ${.ALLSRC} > countries.tmp
152         mv countries.tmp ${.TARGET}
153
154 .include <bsd.prog.mk>