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 2016 Toomas Soome <tsoome@me.com>
14 # Copyright 2016 RackTop Systems.
15 #
16
17 include $(SRC)/Makefile.master
18
19 LIB= zfsboot
20
21 all: libzfsboot.a
22
23 libzfsboot.a: machine x86
24
25 clean: clobber
26
27 clobber:
28 $(RM) machine x86 $(OBJS) libzfsboot.a
29
30 CC= $(GCC_ROOT)/bin/gcc
31 CPPFLAGS=
32
33 SRCS += ../zfs.c ../gzip.c
34 OBJS += zfs.o gzip.o
35
36 CFLAGS= -O2 -nostdinc -I../../../../include -I../../..
37 CFLAGS += -I../../common -I../../.. -I.. -I.
38 CFLAGS += -I../../../../lib/libstand
39 CFLAGS += -I../../../../lib/libz
40 CFLAGS += -I../../../cddl/boot/zfs
41
42 CFLAGS += -ffreestanding
43 CFLAGS += -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
44 CFLAGS += -Wformat -Wall -std=gnu99
45
46 CLEANFILES += machine x86
47
48 machine:
49 $(RM) machine
50 $(SYMLINK) ../../../$(MACHINE)/include machine
51
52 x86:
53 $(RM) x86
54 $(SYMLINK) ../../../x86/include x86
55
56 libzfsboot.a: $(OBJS)
57 $(AR) $(ARFLAGS) $@ $(OBJS)
58
59 %.o: ../%.c
60 $(COMPILE.c) -o $@ $<
61
62 zfs.o: ../zfsimpl.c