Fully synchronize sys/boot from FreeBSD-5.x, but add / to the module path
[dragonfly.git] / sys / boot / alpha / common / Makefile.common
CommitLineData
5ee58eed
MD
1# $FreeBSD$
2# $DragonFly: src/sys/boot/alpha/common/Attic/Makefile.common,v 1.3 2003/11/10 06:08:29 dillon Exp $
984263bc
MD
3#
4# Common Alpha loader build rules
5
6.PATH: ${.CURDIR}/../common
7
8# Alpha-specific bootstrap sources
9SRCS+= main.c conf.c
10.if ${BASE} == netboot
11SRCS+= dev_net.c
12.endif
13
5ee58eed 14.if !defined(NOFORTH)
984263bc
MD
15# Enable BootForth
16BOOT_FORTH= yes
984263bc 17CFLAGS+= -DBOOT_FORTH
5ee58eed 18CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/alpha
984263bc
MD
19.if exists(${.OBJDIR}/../../ficl/libficl.a)
20LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
21.else
22LIBFICL= ${.CURDIR}/../../ficl/libficl.a
23.endif
5ee58eed 24.endif
984263bc
MD
25
26# Always add MI sources
27.PATH: ${.CURDIR}/../../common
28.include <${.CURDIR}/../../common/Makefile.inc>
29CFLAGS+= -mno-fp-regs
30CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
31CFLAGS+= -I${.CURDIR}/../../.. -I.
32CFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
33 -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}
34
35CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
36 vers.c vers.o ${BASE} ${BASE}.sym ${BASE}.list
37
38CFLAGS+= -Wall
39
40CFLAGS+= -I${LIBSTANDDIR}
41CFLAGS+= -I${.CURDIR}/..
42CRT= start.o
43STRIP=
44BINDIR?= /boot
45INSTALLFLAGS?= -b
46
5ee58eed 47all: ${BASE} ${BASE}.help
984263bc
MD
48
49vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
50 sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
51 ${CC} -c vers.c
52
5ee58eed 53${BASE}: ${OBJS} ${LIBSTAND} ${LIBFICL} ${LIBALPHA} ${CRT} vers.o
984263bc 54 ${LD} -o ${BASE}.sym -M -e start -N -Ttext ${LOAD_ADDRESS} \
5ee58eed 55 ${CRT} ${OBJS} vers.o \
984263bc
MD
56 -L${DESTDIR}${LIBDIR} ${LIBSTAND} ${LIBALPHA} ${LIBFICL} ${LIBSTAND} \
57 >${.OBJDIR}/${BASE}.list
5ee58eed 58 objcopy -O binary ${BASE}.sym ${BASE}
984263bc
MD
59
60CLEANFILES+= ${BASE}.help
61${BASE}.help: help.common help.alpha
62 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
63
64beforeinstall:
65.ifdef INSTALL_HELP
66.if exists(${.OBJDIR}/${BASE}.help)
67 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
68 ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
69.else
70 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
71 ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
72.endif
73.endif
74.if !exists(${DESTDIR}/boot/loader.rc)
75 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
76 ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
77.endif
78 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
79 ${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
80 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
81 ${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
82 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
83 ${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
84
85
86start.o: ${.CURDIR}/../libalpha/start.S
87 ${CC} -c ${CFLAGS} $<
88
984263bc
MD
89machine:
90 ln -sf ${.CURDIR}/../../../alpha/include machine
91
92CLEANFILES+= machine
93
94.include <bsd.prog.mk>
95
984263bc 96beforedepend ${OBJS}: machine