199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# This file and its contents are supplied under the terms of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# You may only use this file in accordance with the terms of version
199767f8919635c4928607450d9e0abb932109ceToomas Soome# 1.0 of the CDDL.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# A full copy of the text of the CDDL should have accompanied this
199767f8919635c4928607450d9e0abb932109ceToomas Soome# source. A copy of the CDDL is also available via the Internet at
199767f8919635c4928607450d9e0abb932109ceToomas Soome# http://www.illumos.org/license/CDDL.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Copyright 2015 Toomas Soome <tsoome@me.com>
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soome# x86 EFI pmbr build rules
199767f8919635c4928607450d9e0abb932109ceToomas Soome#
199767f8919635c4928607450d9e0abb932109ceToomas Soomeinclude $(SRC)/Makefile.master
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeROOT_BOOT = $(ROOT)/boot
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomePROG= pmbr
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#AS= $(GNU_ROOT)/bin/gas
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLD= $(GNU_ROOT)/bin/gld
199767f8919635c4928607450d9e0abb932109ceToomas SoomeSTRIP= # no strip is needed
199767f8919635c4928607450d9e0abb932109ceToomas SoomeFILEMODE=0444
199767f8919635c4928607450d9e0abb932109ceToomas SoomeMAN=
199767f8919635c4928607450d9e0abb932109ceToomas SoomeOBJS= pmbr.o
199767f8919635c4928607450d9e0abb932109ceToomas SoomeSRCS= $(OBJS:%.o=%.s)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeORG= 0x600
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas SoomeAS_CPPFLAGS= # no CPP for now
199767f8919635c4928607450d9e0abb932109ceToomas SoomeASFLAGS=--32 --divide
199767f8919635c4928607450d9e0abb932109ceToomas SoomeLDFLAGS=-e start -Ttext ${ORG} -N -S --oformat binary
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeall: $(PROG)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeinstall: $(PROG:%=$(ROOT_BOOT)/%)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome$(PROG): $(OBJS)
199767f8919635c4928607450d9e0abb932109ceToomas Soome $(LD) $(LDFLAGS) -o $(PROG) $(OBJS)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeclobber: clean
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomeclean:
199767f8919635c4928607450d9e0abb932109ceToomas Soome $(RM) $(PROG) $(OBJS)
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome$(ROOT_BOOT)/%: %
199767f8919635c4928607450d9e0abb932109ceToomas Soome $(INS.file)