Deleted Added
full compact
Makefile (125517) Makefile (125537)
1# $FreeBSD: head/sys/boot/i386/loader/Makefile 125517 2004-02-06 12:58:32Z ru $
1# $FreeBSD: head/sys/boot/i386/loader/Makefile 125537 2004-02-06 21:58:32Z ru $
2
2
3PROG= loader
4STRIP=
5NEWVERSWHAT= "bootstrap loader" i386
3NEWVERSWHAT= "bootstrap loader" i386
6INSTALLFLAGS= -b
7
8# architecture-specific loader code
4
5# architecture-specific loader code
9SRCS= main.c conf.c
6SRCS= main.c conf.c vers.c
10
11CFLAGS+= -ffreestanding
12# Enable PXE TFTP or NFS support, not both.
13.if defined(LOADER_TFTP_SUPPORT)
14CFLAGS+= -DLOADER_TFTP_SUPPORT
15.else
16CFLAGS+= -DLOADER_NFS_SUPPORT
17.endif

--- 19 unchanged lines hidden (view full) ---

37.if !defined(LOADER_NO_GZIP_SUPPORT)
38CFLAGS+= -DLOADER_GZIP_SUPPORT
39.endif
40
41# Always add MI sources
42.PATH: ${.CURDIR}/../../common
43.include "${.CURDIR}/../../common/Makefile.inc"
44CFLAGS+= -I${.CURDIR}/../../common
7
8CFLAGS+= -ffreestanding
9# Enable PXE TFTP or NFS support, not both.
10.if defined(LOADER_TFTP_SUPPORT)
11CFLAGS+= -DLOADER_TFTP_SUPPORT
12.else
13CFLAGS+= -DLOADER_NFS_SUPPORT
14.endif

--- 19 unchanged lines hidden (view full) ---

34.if !defined(LOADER_NO_GZIP_SUPPORT)
35CFLAGS+= -DLOADER_GZIP_SUPPORT
36.endif
37
38# Always add MI sources
39.PATH: ${.CURDIR}/../../common
40.include "${.CURDIR}/../../common/Makefile.inc"
41CFLAGS+= -I${.CURDIR}/../../common
45CFLAGS+= -I${.CURDIR}/../../.. -I.
42CFLAGS+= -I.
46
43
47CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help
44CLEANFILES= vers.c loader loader.list loader.bin loader.sym loader.help
48
49CFLAGS+= -Wall
50LDFLAGS= -nostdlib -static -Ttext 0x0
51
52# i386 standalone support library
53LIBI386= ${.OBJDIR}/../libi386/libi386.a
54CFLAGS+= -I${.CURDIR}/..
55
45
46CFLAGS+= -Wall
47LDFLAGS= -nostdlib -static -Ttext 0x0
48
49# i386 standalone support library
50LIBI386= ${.OBJDIR}/../libi386/libi386.a
51CFLAGS+= -I${.CURDIR}/..
52
56# where to get libstand from
57#XXX need a better way to do this
58LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
59.if !exists(${LIBSTAND})
60LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
61.if !exists(${LIBSTAND})
62LIBSTAND= -lstand
63.endif
64.endif
65CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
66
67# BTX components
53# BTX components
68.if exists(${.OBJDIR}/../btx)
69BTXDIR= ${.OBJDIR}/../btx
70.else
71BTXDIR= ${.CURDIR}/../btx
72.endif
73BTXLDR= ${BTXDIR}/btxldr/btxldr
74BTXKERN= ${BTXDIR}/btx/btx
75BTXCRT= ${BTXDIR}/lib/crt0.o
76CFLAGS+= -I${.CURDIR}/../btx/lib
77
78# BTX is expecting ELF components
79CFLAGS+= -elf
80
81# Debug me!
82#CFLAGS+= -g
83#LDFLAGS+= -g
84
54CFLAGS+= -I${.CURDIR}/../btx/lib
55
56# BTX is expecting ELF components
57CFLAGS+= -elf
58
59# Debug me!
60#CFLAGS+= -g
61#LDFLAGS+= -g
62
85vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
63# Pick up ../Makefile.inc early.
64.include <bsd.init.mk>
65
66vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
86 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
67 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
87 ${CC} ${CFLAGS} -c vers.c
88
68
89${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
69loader: loader.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
90 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
70 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
91 -b ${BTXKERN} ${PROG}.bin
71 -b ${BTXKERN} loader.bin
92# /usr/bin/kzip ${.TARGET}
93# mv ${.TARGET}.kz ${.TARGET}
94
72# /usr/bin/kzip ${.TARGET}
73# mv ${.TARGET}.kz ${.TARGET}
74
95${PROG}.bin: ${PROG}.sym
75loader.bin: loader.sym
96 cp ${.ALLSRC} ${.TARGET}
97 strip -R .comment -R .note ${.TARGET}
98
76 cp ${.ALLSRC} ${.TARGET}
77 strip -R .comment -R .note ${.TARGET}
78
99${PROG}.help: help.common help.i386
79loader.help: help.common help.i386
100 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
101
102.PATH: ${.CURDIR}/../../forth
80 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
81
82.PATH: ${.CURDIR}/../../forth
103FILES= ${PROG}.help loader.4th support.4th loader.conf
83FILES= loader loader.help loader.4th support.4th loader.conf
104FILES+= screen.4th frames.4th beastie.4th
84FILES+= screen.4th frames.4th beastie.4th
85# XXX INSTALLFLAGS_loader= -b
86FILESMODE_loader= ${BINMODE} -b
105FILESDIR_loader.conf= /boot/defaults
106
107.if !exists(${DESTDIR}/boot/loader.rc)
108FILES+= ${.CURDIR}/loader.rc
109.endif
110
87FILESDIR_loader.conf= /boot/defaults
88
89.if !exists(${DESTDIR}/boot/loader.rc)
90FILES+= ${.CURDIR}/loader.rc
91.endif
92
111# Cannot use ${OBJS} above this line
112.include <bsd.prog.mk>
93OBJS= ${SRCS:N*.h:R:S/$/.o/g}
113
94
114${PROG}.sym: ${OBJS} ${LIBI386} ${LIBSTAND} ${LIBFICL} vers.o
115 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
95loader.sym: ${OBJS} ${LIBFICL} ${LIBI386} ${LIBSTAND}
96 ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} \
116 ${LIBFICL} ${LIBI386} ${LIBSTAND}
117
97 ${LIBFICL} ${LIBI386} ${LIBSTAND}
98
118# If it's not there, don't consider it a target
119.if exists(${.CURDIR}/../../../i386/include)
120beforedepend ${OBJS}: machine
121
99.if defined(REALLY_AMD64)
100${OBJS}: machine
101CLEANFILES+= machine
122machine:
123 ln -sf ${.CURDIR}/../../../i386/include machine
102machine:
103 ln -sf ${.CURDIR}/../../../i386/include machine
124
125.endif
126
104.endif
105
127CLEANFILES+= machine
106.include <bsd.prog.mk>