2
# GRUB Utilities -- Utilities for GRUB Legacy, GRUB2 and GRUB for DOS
3
# Copyright (C) 2007 Bean (bean123ch@gmail.com)
5
# This program is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU Affero General Public License as
7
# published by the Free Software Foundation, either version 3 of the
8
# License, or (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU Affero General Public License for more details.
15
# You should have received a copy of the GNU Affero General Public License
16
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
SRCDIR := $(dir $(firstword $(MAKEFILE_LIST)))
25
extra_SRCS = Makefile version fbmbr.S fbinst.h
29
cmn_SRCS = common.mk ldscript keytab.c keytab.h bin2h.c bin2h.pl ver2h.c ver2h.pl utils.c utils.h xdio.c xdio.h xd16.asm
31
all_SRCS := fbinst.c $(extra_SRCS)
33
all_EXES = fbinst$(EXEEXT)
35
extra_CLEAN = fb.mbr version.h fb_mbr.h
37
-include common.mk $(SRCDIR)../common/common.mk
39
fbinst$(EXEEXT): fbinst.o xdio.o keytab.o
40
$(CC) $(CFLAGS) -o$@ $^
42
fbinst.o: version.h fbinst.h fb_mbr_rel.h fb_mbr_dbg.h
44
fb_rel.mbr: fbmbr.S version.h fbinst.h
45
$(CC) -nostdlib -I. -I$(SRCDIR) -Wl,-N -Wl,-T -Wl,$(CMNDIR)ldscript -o fb$(EXEEXT) $<
46
$(OC) -O binary fb$(EXEEXT) $@
49
fb_mbr_rel.h: fb_rel.mbr $(BIN2H_DEPS)
50
$(BIN2H_EXEC) $< $@ fb_mbr_rel
52
fb_dbg.mbr: fbmbr.S version.h fbinst.h
53
$(CC) -nostdlib -I. -I$(SRCDIR) -DDEBUG -DDEBUG_INT13 -Wl,-N -Wl,-T -Wl,$(CMNDIR)ldscript -o fb$(EXEEXT) $<
54
$(OC) -O binary fb$(EXEEXT) $@
57
fb_mbr_dbg.h: fb_dbg.mbr $(BIN2H_DEPS)
58
$(BIN2H_EXEC) $< $@ fb_mbr_dbg