xref: /illumos-gate/usr/src/boot/Makefile.lib (revision 7c34a79b137bcbd26ee8292e08e8bf031e93089f)
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
20CSTD=$(CSTD_GNU99)
21$(PICS) := CFLAGS += -_gcc=-fPIC
22$(PICS) := CCASFLAGS += -_gcc=-fPIC
23
24$(OBJS) $(PICS): machine x86
25
26objs pics:
27	-@mkdir -p $@
28
29$(LIBRARY): objs .WAIT $$(OBJS)
30	$(RM) $@
31	$(AR) $(ARFLAGS) $@ $(OBJS)
32
33$(DYNLIB): pics .WAIT $$(PICS)
34	$(RM) $@
35	$(AR) $(ARFLAGS) $@ $(PICS)
36
37CLEANFILES +=	$(OBJS) $(PICS) $(LIBRARY) $(DYNLIB)
38