xref: /titanic_53/usr/src/boot/sys/boot/libstand/Makefile.com (revision 9533a635ba7c47e84834ff9d71ef2ec040ff2bdb)
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
17include $(SRC)/Makefile.master
18
19AS=	$(GNU_ROOT)/bin/gas
20LD=	$(GNU_ROOT)/bin/gld
21CC=	$(GCC_ROOT)/bin/gcc
22
23LIBRARY=	libstand.a
24
25all install: $(LIBRARY)
26
27LIB_BASE=	$(SRC)/boot/lib
28LIBSTAND_SRC=	$(LIB_BASE)/libstand
29
30CPPFLAGS =	-nostdinc -I../../../../include -I${LIBSTAND_SRC} -I../../..
31CPPFLAGS +=	-I../../../sys -I. -I$(SRC)/common/bzip2
32
33CFLAGS =	-O2 -ffreestanding -Wformat
34CFLAGS +=	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
35CFLAGS +=	-Wno-pointer-sign -Wno-empty-body -Wno-unused-value \
36		-Wno-unused-function -Wno-switch \
37		-Wno-switch-enum -Wno-parentheses
38
39include ${LIBSTAND_SRC}/Makefile.inc
40
41$(LIBRARY): $(SRCS) $(OBJS)
42	$(AR) $(ARFLAGS) $@ $(OBJS)
43
44clean: clobber
45clobber:
46	$(RM) $(CLEANFILES) $(OBJS) machine x86 libstand.a
47
48machine:
49	$(RM) machine
50	$(SYMLINK) ../../../$(MACHINE)/include machine
51
52x86:
53	$(RM) x86
54	$(SYMLINK) ../../../x86/include x86
55
56$(OBJS): machine x86
57
58%.o:	$(LIBSTAND_SRC)/%.c
59	$(COMPILE.c) $<
60
61%.o:	$(LIB_BASE)/libc/net/%.c
62	$(COMPILE.c) $<
63
64%.o:	$(LIB_BASE)/libc/string/%.c
65	$(COMPILE.c) $<
66
67%.o:	$(LIB_BASE)/libc/uuid/%.c
68	$(COMPILE.c) $<
69
70%.o:	$(LIB_BASE)/libz/%.c
71	$(COMPILE.c) $<
72