File: Make.gnuefi

package info (click to toggle)
refind 0.14.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 9,432 kB
  • sloc: ansic: 52,757; sh: 2,086; python: 592; makefile: 351; perl: 5
file content (48 lines) | stat: -rw-r--r-- 1,483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# filesystems/Make.gnuefi
# Build control file for the EFI drivers, as built with GNU-EFI
#

# This program is licensed under the terms of the GNU GPL, version 3,
# or (at your option) any later version.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

SRCDIR = .

VPATH = $(SRCDIR)
HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)

LOCAL_GNUEFI_CFLAGS   = -DFSTYPE=$(DRIVERNAME) -I$(SRCDIR) 
ifeq ($(HOSTARCH),x86_64)
  LOCAL_GNUEFI_CFLAGS += "-DEFIAPI=__attribute__((ms_abi))" 
endif

OBJS            = fsw_core.o fsw_efi.o fsw_efi_lib.o fsw_lib.o fsw_$(DRIVERNAME).o
TARGET          = $(DRIVERNAME)_$(FILENAME_CODE).efi

include $(SRCDIR)/../Make.common

all: $(TARGET)

ifeq ($(HOSTARCH),aarch64)
  # Set symbol for driver
  SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xb
endif

$(SHLIB_TARGET): $(OBJS)
	$(LD) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS)

$(TARGET): $(SHLIB_TARGET)
	$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rodata \
	           -j .rel -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
		   -j .reloc --strip-unneeded $(FORMAT_DRIVER) $< $@
ifneq ($(OMIT_SBAT), 1)
		   $(OBJCOPY) --add-section .sbat=$(SRCDIR)/../$(REFIND_SBAT_CSV) \
		   --adjust-section-vma .sbat+10000000 $@
endif
	chmod a-x $(TARGET)
	mkdir -p ../drivers_$(FILENAME_CODE)
	cp $(TARGET) ../drivers_$(FILENAME_CODE)

# EOF