xref: /illumos-gate/usr/src/tools/btxld/Makefile (revision 5801b0f01c3c34499a929ed96164a5a68b470945)
10cc5983cSToomas Soome#
20cc5983cSToomas Soome# This file and its contents are supplied under the terms of the
30cc5983cSToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0.
40cc5983cSToomas Soome# You may only use this file in accordance with the terms of version
50cc5983cSToomas Soome# 1.0 of the CDDL.
60cc5983cSToomas Soome#
70cc5983cSToomas Soome# A full copy of the text of the CDDL should have accompanied this
80cc5983cSToomas Soome# source.  A copy of the CDDL is also available via the Internet at
90cc5983cSToomas Soome# http://www.illumos.org/license/CDDL.
100cc5983cSToomas Soome#
110cc5983cSToomas Soome
120cc5983cSToomas Soome#
130cc5983cSToomas Soome# Copyright 2016 Toomas Soome <tsoome@me.com>
140cc5983cSToomas Soome#
1593b88728SJohn Levon# Copyright (c) 2018, Joyent, Inc.
160cc5983cSToomas Soome
170cc5983cSToomas Soomeinclude ../Makefile.tools
180cc5983cSToomas Soome
190cc5983cSToomas Soome.KEEP_STATE:
200cc5983cSToomas Soome
210cc5983cSToomas SoomeCOMMON_SRC=	$(SRC)/cmd/boot/common
220cc5983cSToomas SoomeEINFO_SRC=	$(COMMON_SRC)/bblk_einfo.c
230cc5983cSToomas SoomeUTILS_SRC=	$(COMMON_SRC)/boot_utils.c
240cc5983cSToomas SoomeEXTRA_SRC=	$(COMMON_SRC)/mboot_extra.c
250cc5983cSToomas Soome
260cc5983cSToomas SoomePROG=		btxld
270b5e2468SToomas SoomeMAN1ONBLDFILES=	btxld.1onbld
280cc5983cSToomas SoomeSRCS=		btxld.c elfh.c version.c $(UTILS_SRC) $(EINFO_SRC) $(EXTRA_SRC)
290cc5983cSToomas SoomeOBJS=		btxld.o elfh.o version.o bblk_einfo.o mboot_extra.o boot_utils.o
300cc5983cSToomas SoomeLDLIBS +=	-lmd5
31*5801b0f0SToomas SoomeNATIVE_LIBS +=	libmd5.so
32bd0ce624SYuri PankovCSTD=	$(CSTD_GNU99)
330cc5983cSToomas SoomeCPPFLAGS +=	-I$(SRC)/uts/common -I$(COMMON_SRC)
340cc5983cSToomas Soome
3593b88728SJohn Levon# not linted
3693b88728SJohn LevonSMATCH=off
3793b88728SJohn Levon
380b5e2468SToomas Soome$(ROOTONBLDMAN1ONBLDFILES)	:= FILEMODE=	644
390b5e2468SToomas Soome
400b5e2468SToomas Soomeall: $(PROG) $(MAN1ONBLDFILES)
410cc5983cSToomas Soome
420cc5983cSToomas Soome$(PROG): $(OBJS)
430cc5983cSToomas Soome	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
440cc5983cSToomas Soome	$(POST_PROCESS)
450cc5983cSToomas Soome
460b5e2468SToomas Soomeinstall: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES)
470cc5983cSToomas Soome
480cc5983cSToomas Soomeclean:
490cc5983cSToomas Soome	$(RM) $(OBJS)
500cc5983cSToomas Soome
510cc5983cSToomas Soome%.o:	%.c
520cc5983cSToomas Soome	$(COMPILE.c) -o $@ $<
530cc5983cSToomas Soome	$(POST_PROCESS_O)
540cc5983cSToomas Soome
550cc5983cSToomas Soome%.o:	$(COMMON_SRC)/%.c
560cc5983cSToomas Soome	$(COMPILE.c) -o $@ $<
570cc5983cSToomas Soome	$(POST_PROCESS_O)
580cc5983cSToomas Soome
590cc5983cSToomas Soomeinclude ../Makefile.targ
60