1150a6952SToomas Soome# 2150a6952SToomas Soome# This file and its contents are supplied under the terms of the 3150a6952SToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0. 4150a6952SToomas Soome# You may only use this file in accordance with the terms of version 5150a6952SToomas Soome# 1.0 of the CDDL. 6150a6952SToomas Soome# 7150a6952SToomas Soome# A full copy of the text of the CDDL should have accompanied this 8150a6952SToomas Soome# source. A copy of the CDDL is also available via the Internet at 9150a6952SToomas Soome# http://www.illumos.org/license/CDDL. 10150a6952SToomas Soome# 11150a6952SToomas Soome 12150a6952SToomas Soome# 13150a6952SToomas Soome# Copyright 2016 Toomas Soome <tsoome@me.com> 14150a6952SToomas Soome# 15150a6952SToomas Soome 16150a6952SToomas Soomeinclude ../Makefile.tools 17150a6952SToomas Soome 18150a6952SToomas Soome.KEEP_STATE: 19150a6952SToomas Soome 20150a6952SToomas SoomeCOMMON_SRC= $(SRC)/cmd/boot/common 21150a6952SToomas SoomeEINFO_SRC= $(COMMON_SRC)/bblk_einfo.c 22150a6952SToomas SoomeUTILS_SRC= $(COMMON_SRC)/boot_utils.c 23150a6952SToomas SoomeEXTRA_SRC= $(COMMON_SRC)/mboot_extra.c 24150a6952SToomas Soome 25150a6952SToomas SoomePROG= btxld 26*ba11c5b5SToomas SoomeMAN1ONBLDFILES= btxld.1onbld 27150a6952SToomas SoomeSRCS= btxld.c elfh.c version.c $(UTILS_SRC) $(EINFO_SRC) $(EXTRA_SRC) 28150a6952SToomas SoomeOBJS= btxld.o elfh.o version.o bblk_einfo.o mboot_extra.o boot_utils.o 29150a6952SToomas SoomeLDLIBS += -lmd5 30150a6952SToomas SoomeC99MODE= $(C99_ENABLE) 31150a6952SToomas SoomeCPPFLAGS += -I$(SRC)/uts/common -I$(COMMON_SRC) 32150a6952SToomas Soome 33*ba11c5b5SToomas Soome$(ROOTONBLDMAN1ONBLDFILES) := FILEMODE= 644 34*ba11c5b5SToomas Soome 35*ba11c5b5SToomas Soomeall: $(PROG) $(MAN1ONBLDFILES) 36150a6952SToomas Soome 37150a6952SToomas Soome$(PROG): $(OBJS) 38150a6952SToomas Soome $(LINK.c) -o $@ $(OBJS) $(LDLIBS) 39150a6952SToomas Soome $(POST_PROCESS) 40150a6952SToomas Soome 41*ba11c5b5SToomas Soomeinstall: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDMAN1ONBLDFILES) 42150a6952SToomas Soome 43150a6952SToomas Soomeclean: 44150a6952SToomas Soome $(RM) $(OBJS) 45150a6952SToomas Soome 46150a6952SToomas Soome%.o: %.c 47150a6952SToomas Soome $(COMPILE.c) -o $@ $< 48150a6952SToomas Soome $(POST_PROCESS_O) 49150a6952SToomas Soome 50150a6952SToomas Soome%.o: $(COMMON_SRC)/%.c 51150a6952SToomas Soome $(COMPILE.c) -o $@ $< 52150a6952SToomas Soome $(POST_PROCESS_O) 53150a6952SToomas Soome 54150a6952SToomas Soomeinclude ../Makefile.targ 55