xref: /titanic_53/usr/src/boot/sys/boot/i386/cdboot/Makefile (revision 4a5d661a82b942b6538acd26209d959ce98b593a)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2015 Toomas Soome <tsoome@me.com>
14#
15
16include $(SRC)/Makefile.master
17
18ROOT_BOOT = $(ROOT)/boot
19
20LD=	$(GNU_ROOT)/bin/gld
21CC=	$(GCC_ROOT)/bin/gcc
22
23CFLAGS =	-O2 -I../common -march=i386 -ffreestanding -mno-mmx -mno-3dnow
24CFLAGS +=	-mno-sse -mno-sse2 -mno-sse3 -msoft-float -std=gnu99 -m32
25CPPFLAGS=
26CCASFLAGS=	-Wa,--divide
27
28PROG=	cdboot
29STRIP=
30FILEMODE=0444
31MAN=
32SRCS=	${PROG}.S
33OBJS=	$(SRCS:%.S=%.o)
34
35
36ORG=	0x7c00
37
38LDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary
39
40all:	${PROG}
41
42install: $(PROG:%=$(ROOT_BOOT)/%)
43
44${PROG}: ${OBJS}
45	${LD} ${LDFLAGS} -o $@ $^
46
47clobber: clean
48clean:
49	$(RM) $(PROG) $(OBJS)
50
51.S.o:
52	$(CC) $(CFLAGS) $(CCASFLAGS) -c -o $@ $<
53
54$(ROOT_BOOT)/%: %
55	$(INS.file)
56