## -----------------------------------------------------------------------
##
## Copyright 1998-2009 H. Peter Anvin - All Rights Reserved
-## Copyright 2009 Intel Corporation; author: H. Peter Anvin
+## Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
MAKE += -r
topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
-include $(topdir)/version.mk
OPTFLAGS =
# The targets to build in this directory...
BTARGET = kwdhash.gen \
- extlinux.bin extlinux.bss extlinux.sys \
ldlinux.bss ldlinux.sys ldlinux.bin \
isolinux.bin isolinux-debug.bin pxelinux.0
SOBJ := $(patsubst %.S,%.o,$(SSRC))
LIB = libcore.a
-LIBS = $(LIB) $(com32)/lib/libcom32.a $(LIBGCC)
+LIBS = $(LIB) $(com32)/lib/libcomcore.a $(LIBGCC)
LIBOBJS = $(COBJ) $(SOBJ)
NASMDEBUG = -g -F dwarf
PREPCORE = ../lzo/prepcore
+# CFLAGS += -DDEBUG=1
+
# The DATE is set on the make command line when building binaries for
# official release. Otherwise, substitute a hex string that is pretty much
# guaranteed to be unique to be unique from build to build.
%.raw: %.elf
$(OBJCOPY) -O binary $< $(@:.bin=.raw)
+# GNU make 3.82 gets confused by the first form
+.PRECIOUS: %.raw
+
%.bin: %.raw $(PREPCORE)
$(PREPCORE) $< $@
-l $(@:.o=.lsr) -o $@ -MP -MD .$@.d $<
%.elf: %.o $(LIBS) syslinux.ld
- $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< $(LIBS) \
+ $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< \
+ --start-group $(LIBS) --end-group \
> $(@:.elf=.map)
$(OBJDUMP) -h $@ > $(@:.elf=.sec)
$(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
dd if=$< of=$@ bs=512 count=1
ldlinux.sys: ldlinux.bin
- dd if=$< of=$@ bs=512 skip=1
-
-extlinux.bss: extlinux.bin
- dd if=$< of=$@ bs=512 count=1
-
-extlinux.sys: extlinux.bin
- dd if=$< of=$@ bs=512 skip=1
-
-# NASM prior to 2.03 wouldn't auto-generate this dependency...
-ldlinux.o: codepage.cp
+ dd if=$< of=$@ bs=512 skip=2
codepage.cp: ../codepage/$(CODEPAGE).cp
cp -f $< $@
+codepage.o: codepage.S codepage.cp
+
install: installer
install-lib: installer
rm -f *.elf.tmp *.sym
rm -f *.lsr *.lst *.map *.sec *.raw
rm -f */*.o */*/*.o */*.lst */*/*.lst */.*.d */*/.*.d
- rm -f $(OBSOLETE)
+ rm -f $(OBSOLETE) $(LIB)
clean: tidy
rm -f $(BTARGET) *.bin *_bin.c
# Include dependencies file
--include .*.d */.*.d
+-include .*.d */.*.d */*/.*.d