diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-09-25 14:45:18 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-10-16 11:38:01 +0100 |
commit | 1408e6ca7b3854d94aaa39612b4bb6fdf9111dc7 (patch) | |
tree | e624fe7c8d9bea91724a1e12708464a7cc035096 /memdisk | |
parent | 34a0d7f60f1beca980f7b4a9516581c91380fdb3 (diff) | |
download | syslinux-1408e6ca7b3854d94aaa39612b4bb6fdf9111dc7.tar.gz |
Add per-firmware object directory support
Now that we have multiple firmware backends it no longer makes sense
to write object files to the same directory as their source. A better
solution is to write the object files to a per-firmware directory
under a top-level object directory.
The top-level object directory can be specified on the command-line
with the O= variable, e.g. make O=/tmp/obj. If no top-level object
directory is specified an 'obj' directory is created in the top-level
of the Syslinux source repository.
All the existing make targets continue to work as before, however now
they apply to all firmware backends, e.g. 'make installer' will build
the BIOS, 32-bit EFI and 64-bit EFI installers and place them under
$(OBJ)/bios, $(OBJ)/efi32 and $(OBJ)/efi64 respectively.
Note unlike every other bit of Syslinux, the gpxe objects are still
kept in the src directory, e.g. gpxe/src, since gpxe is only required
by the BIOS backend.
It is possible to specify a make target for a specific firmware or
list of firmware with the following syntax,
make [firmware[,firmware]] [target[,target]]
To clean the object directory for just the BIOS firmware type,
'make bios clean'
To build both the 32-bit and 64-bit EFI installers type,
'make efi32 efi64 installer'
Since the Syslinux make infrastructure is now more complex a new file
doc/building.txt has been created to explain how to build Syslinux.
The top-level Makefile now exports some make variables for use in
module Makefiles,
- topdir - the top-level source directory of the Syslinux
repository, e.g. /usr/src/syslinux
- objdir - the top-level object directory for the firmware
backend currently being built, e.g. /obj/syslinux/bios
- SRC - the source directory in the Syslinux repository for the
module currently being built,
e.g. /usr/src/syslinux/com32/libupload
- OBJ - the object directory for the module currently being
built, e.g. /obj/syslinux/bios/com32/libupload
Since we're rewriting the Makefile infrastructure anyway it seemed
like a good idea to add parallel support. By writing subdirectories as
prequisites for make targets the objects in those subdirectories can
be built in parallel.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'memdisk')
-rw-r--r-- | memdisk/Makefile | 13 | ||||
-rw-r--r-- | memdisk/setup.c | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/memdisk/Makefile b/memdisk/Makefile index 36689979..4ae08554 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -11,29 +11,28 @@ ## ## ----------------------------------------------------------------------- -topdir = .. -MAKEDIR = $(topdir)/mk include $(MAKEDIR)/embedded.mk -include $(topdir)/version.mk -INCLUDES = -I$(topdir)/com32/include +INCLUDES = -I$(topdir)/com32/include -I$(objdir) CFLAGS += -D__MEMDISK__ -DDATE='"$(DATE)"' LDFLAGS = $(GCCOPT) -g NASM = nasm NASMOPT = -Ox NFLAGS = -dDATE='"$(DATE)"' -NINCLUDE = +NINCLUDE = -I$(SRC)/ +VPATH = $(SRC) SRCS = $(wildcard *.asm *.c *.h) # 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. ifndef HEXDATE -HEXDATE := $(shell $(PERL) ../now.pl $(SRCS)) +HEXDATE := $(shell $(PERL) $(SRC)/../now.pl $(SRCS)) endif ifndef DATE -DATE := $(shell sh ../gen-id.sh $(VERSION) $(HEXDATE)) +DATE := $(shell sh $(SRC)/../gen-id.sh $(VERSION) $(HEXDATE)) endif # Important: init.o16 must be first!! @@ -92,7 +91,7 @@ memdisk32.elf: $(ARCH)/memdisk.ld $(OBJS32) $(OBJCOPY) -O binary $< $@ memdisk: memdisk16.bin memdisk32.bin postprocess.pl - $(PERL) postprocess.pl $@ memdisk16.bin memdisk32.bin + $(PERL) $(SRC)/postprocess.pl $@ memdisk16.bin memdisk32.bin e820test: e820test.c e820func.c msetup.c $(CC) -m32 -g $(GCCWARN) -DTEST -o $@ $^ diff --git a/memdisk/setup.c b/memdisk/setup.c index b6093b7a..72c67852 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -22,7 +22,7 @@ #include "conio.h" #include "version.h" #include "memdisk.h" -#include "../version.h" +#include <version.h> const char memdisk_version[] = "MEMDISK " VERSION_STR " " DATE; const char copyright[] = |