blob: 15d8f7e8a00d8c648c42eff59685050cb3b93e67 [file] [log] [blame]
SRCROOT = ..
include ../MCONFIG
SYSDIR = $(wildcard syslinux-[0-9]*)
MAKEDEPS = -Wp,-MD,.$(subst /,-,$*).d
CFLAGS = $(MAKEDEPS) $(OPTFLAGS) $(REQFLAGS) -W -Wall -DPATCH_OFFSET=`cat $(SYSDIR)/patch.offset`
LIBS = $(KLIBC) $(LIBGCC)
PROGS = syslinux syslinux.shared
OBJS = syslinux-nomtools.o syslxmod.o bootsect_bin.o ldlinux_bin.o
all: $(PROGS)
syslinux: $(OBJS) $(CRT0) $(LIBS)
$(LD) $(LDFLAGS) -o $@ $(CRT0) $(OBJS) $(LIBS)
cp -f $@ $@.g
$(STRIP) $@
syslinux.shared: $(OBJS) $(CRT0) $(LIBS)
$(LD) $(LDFLAGS) -o $@ $(EMAIN) $(CRTSHARED) $(OBJS) -R $(LIBSHARED) $(LIBGCC)
cp -f $@ $@.g
$(STRIP) $@
%.c: $(SYSDIR)/%.c
cp -f $< $@
%.h: $(SYSDIR)/%.h
cp -f $< $@
$(CRT0) $(LIBS):
@echo '*** error: $@ not up to date' || exit 1
clean:
$(RM) *.c *.h *.o $(PROGS) core .*.d
spotless: clean
$(RM) *~
syslinux-nomtools.o: syslinux-nomtools.c syslinux.h
syslxmod.o: syslxmod.c syslinux.h
ifneq ($(wildcard .*.d),)
include $(wildcard .*.d)
endif