xref: /illumos-gate/usr/src/boot/Makefile.lib (revision 22028508)
1# This file and its contents are supplied under the terms of the
2# Common Development and Distribution License ("CDDL"), version 1.0.
3# You may only use this file in accordance with the terms of version
4# 1.0 of the CDDL.
5#
6# A full copy of the text of the CDDL should have accompanied this
7# source.  A copy of the CDDL is also available via the Internet at
8# http://www.illumos.org/license/CDDL.
9#
10
11#
12# Copyright 2021 Toomas Soome <tsoome@me.com>
13#
14
15OBJS=	$(OBJECTS:%=objs/%)
16PICS=	$(OBJECTS:%=pics/%)
17
18.PARALLEL:	$(OBJS) $(PICS) DUMMY
19
20$(PICS) := CFLAGS += -_gcc=-fPIC
21$(PICS) := CCASFLAGS += -_gcc=-fPIC
22
23$(OBJS) $(PICS): machine x86
24
25objs pics:
26	-@mkdir -p $@
27
28$(LIBRARY): objs .WAIT $$(OBJS)
29	$(AR) $(ARFLAGS) $@ $(OBJS)
30
31$(DYNLIB): pics .WAIT $$(PICS)
32	$(AR) $(ARFLAGS) $@ $(PICS)
33
34CLEANFILES +=	$(OBJS) $(PICS) $(LIBRARY) $(DYNLIB)
35