blob: c50adabef23c4825d20720abf5a5bb1615233a33 [file] [log] [blame] [raw]
AUTOMAKE_OPTIONS = gnits
IMPORTANT_SIZE_LIMIT = 7168
pkglibdir = $(exec_prefix)/lib/$(PACKAGE)
pkglib_DATA = fat_stage1_5
CLEANFILES = $(pkglib_DATA) $(pkglib_DATA)T
noinst_PROGRAMS = fat_stage1_5.exec
# We can't use builtins.
COMPILE = $(CC) -fno-builtin -DFSYS_FAT=1 -DNO_DECOMPRESSION=1 \
-DNO_FANCY_STUFF=1 -DCONFIG_FILE_ASM='.string "/boot/grub/stage2"' \
$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
INCLUDES = -I$(top_srcdir)/shared_src
# asm.o absolutely needs to come first!
fat_stage1_5_exec_LDADD = asm.o common.o char_io.o disk_io.o \
stage1_5.o fsys_fat.o
fat_stage1_5_exec_SOURCES = dummy.c # needed to drag in C Makefile variables
DISTFILES = $(DIST_COMMON)
fat_stage1_5.exec: $(fat_stage1_5_exec_LDADD)
$(LD) -N -Ttext 2000 -o $@ $(fat_stage1_5_exec_LDADD)
fat_stage1_5: fat_stage1_5.exec
rm -f $@T $@
$(OBJCOPY) -O binary fat_stage1_5.exec $@T
@set dummy `ls -l $@T`; size=$$6; \
if test $$size -le $(IMPORTANT_SIZE_LIMIT); then \
:; \
else \
echo "WARNING: stage 1.5 is too big for boot block area ($$size > $(IMPORTANT_SIZE_LIMIT))."; \
fi
mv -f $@T $@
@SHARED_SRC_RULES@