[syslinux] [PATCH 1/6] Makefile: Move Makefile fragments into mk/

Matt Fleming matt at console-pimps.org
Sat Apr 16 06:35:32 PDT 2011


From: Matt Fleming <matt.fleming at linux.intel.com>

Move the MCONFIG files into a mk/ directory and give them more
descriptive names.

This is purely a cosmetic change to make the 'include' directives a
bit more coherent by making it obvious exactly which MCONFIG file
we're including. For example, in com32/lua/src/Makefile we exchange
the line,

	include ../../MCONFIG

for the much more comprehensible,

	include $(MAKEDIR)/com32.mk

Signed-off-by: Matt Fleming <matt.fleming at linux.intel.com>
---
 Makefile                           |    3 ++-
 Makefile.private                   |    2 +-
 com32/cmenu/Makefile               |    5 +++--
 com32/gdbstub/Makefile             |    3 ++-
 com32/gfxboot/Makefile             |    3 ++-
 com32/gpllib/Makefile              |    3 ++-
 com32/hdt/Makefile                 |    3 ++-
 com32/lib/Makefile                 |    5 +++--
 com32/libutil/Makefile             |    3 ++-
 com32/lua/src/Makefile             |    3 ++-
 com32/mboot/Makefile               |    3 ++-
 com32/menu/Makefile                |    3 ++-
 com32/modules/Makefile             |    3 ++-
 com32/rosh/Makefile                |    3 ++-
 com32/samples/Makefile             |    3 ++-
 com32/sysdump/Makefile             |    3 ++-
 com32/tools/Makefile               |    4 ++--
 core/Makefile                      |    3 ++-
 diag/geodsp/Makefile               |    2 +-
 diag/mbr/Makefile                  |    3 ++-
 dos/Makefile                       |    3 ++-
 dosutil/Makefile                   |    3 ++-
 extlinux/Makefile                  |    3 ++-
 linux/Makefile                     |    3 ++-
 lzo/Makefile                       |    3 ++-
 mbr/Makefile                       |    3 ++-
 memdisk/Makefile                   |    3 ++-
 memdump/Makefile                   |    3 ++-
 MCONFIG.build => mk/build.mk       |    2 +-
 com32/MCONFIG => mk/com32.mk       |    2 +-
 MCONFIG.devel => mk/devel.mk       |    0
 MCONFIG.embedded => mk/embedded.mk |    2 +-
 com32/lib/MCONFIG => mk/lib.mk     |    2 +-
 com32/rosh/MCONFIG => mk/rosh.mk   |    2 +-
 MCONFIG => mk/syslinux.mk          |    4 ++--
 modules/Makefile                   |    3 ++-
 mtools/Makefile                    |    3 ++-
 sample/Makefile                    |    3 ++-
 utils/Makefile                     |    3 ++-
 39 files changed, 71 insertions(+), 42 deletions(-)
 rename MCONFIG.build => mk/build.mk (97%)
 rename com32/MCONFIG => mk/com32.mk (98%)
 rename MCONFIG.devel => mk/devel.mk (100%)
 rename MCONFIG.embedded => mk/embedded.mk (98%)
 rename com32/lib/MCONFIG => mk/lib.mk (98%)
 rename com32/rosh/MCONFIG => mk/rosh.mk (97%)
 rename MCONFIG => mk/syslinux.mk (96%)

diff --git a/Makefile b/Makefile
index 60a5956..0f500a3 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,8 @@
 # Main Makefile for SYSLINUX
 #
 topdir = .
-include $(topdir)/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/syslinux.mk
 -include $(topdir)/version.mk
 
 #
diff --git a/Makefile.private b/Makefile.private
index c70c204..6ca0598 100644
--- a/Makefile.private
+++ b/Makefile.private
@@ -18,7 +18,7 @@
 .PHONY: official release
 
 # These files are removed when tarballs are generated.
-PRIVATE = Makefile.private MCONFIG.devel
+PRIVATE = Makefile.private mk/devel.mk
 
 GIT_DIR ?= .git
 ABS_GIT_DIR := $(shell cd '$(GIT_DIR)' 2>/dev/null && pwd)
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index 794af74..446bbcd 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -17,11 +17,12 @@
 
 NOGPL := 1
 
-# This must be defined before MCONFIG is included
+# This must be defined before com32.mk is included
 LIBS   = libmenu/libmenu.a
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 CFLAGS	  += -I./libmenu
 
diff --git a/com32/gdbstub/Makefile b/com32/gdbstub/Makefile
index 5513876..38d003c 100644
--- a/com32/gdbstub/Makefile
+++ b/com32/gdbstub/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 CFLAGS += -fPIE
 
diff --git a/com32/gfxboot/Makefile b/com32/gfxboot/Makefile
index 73133e1..183115f 100644
--- a/com32/gfxboot/Makefile
+++ b/com32/gfxboot/Makefile
@@ -12,7 +12,8 @@
 ## -----------------------------------------------------------------------
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 MODULES	  = gfxboot.c32
 
diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
index a174061..1c07068 100644
--- a/com32/gpllib/Makefile
+++ b/com32/gpllib/Makefile
@@ -4,7 +4,8 @@
 
 # Include configuration rules
 topdir = ../..
-include ../lib/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/lib.mk
 
 REQFLAGS += -I../gplinclude
 
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
index 40ea3ac..5b55911 100644
--- a/com32/hdt/Makefile
+++ b/com32/hdt/Makefile
@@ -16,7 +16,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 LIBS	   = ../cmenu/libmenu/libmenu.a ../libutil/libutil_com.a \
 	     ../lib/libcom32.a $(LIBGCC)
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 48a166d..1b25b39 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -4,8 +4,9 @@
 
 # Include configuration rules
 NOGPL := 1
-topdir = ../..
-include MCONFIG
+topdir = ../../
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/lib.mk
 
 LIBOBJS = \
 	abort.o atexit.o atoi.o atol.o atoll.o calloc.o creat.o		\
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index 02789ca..5942a08 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -30,7 +30,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 LIBOBJS	   = ansiline.o ansiraw.o get_key.o sha1hash.o unbase64.o \
 	     md5.o crypt-md5.o sha256crypt.o sha512crypt.o base64.o
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 4081bfe..04ea255 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -16,7 +16,8 @@
 ##
 
 topdir = ../../..
-include ../../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 LIBS	   = ../../lib/libcom32.a $(LIBGCC)
 LNXLIBS	   = 
diff --git a/com32/mboot/Makefile b/com32/mboot/Makefile
index 7e6c2e9..cad320f 100644
--- a/com32/mboot/Makefile
+++ b/com32/mboot/Makefile
@@ -16,7 +16,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 LIBS	   = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
 LNXLIBS	   = ../libutil/libutil_lnx.a
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index 2a03272..f97a804 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 LIBS	   = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
 LNXLIBS	   = ../libutil/libutil_lnx.a
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 2d47913..6951b92 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -16,7 +16,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 MODULES	  = chain.c32 config.c32 ethersel.c32 dmitest.c32 cpuidtest.c32 \
 	    disk.c32 pcitest.c32 elf.c32 linux.c32 reboot.c32 pmload.c32 \
diff --git a/com32/rosh/Makefile b/com32/rosh/Makefile
index f4b7d86..766f68d 100644
--- a/com32/rosh/Makefile
+++ b/com32/rosh/Makefile
@@ -17,7 +17,8 @@
 ##
 
 topdir = ../..
-include MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/rosh.mk
 
 # from com32/sysdump/Makefile
 # The DATE is set on the make command line when building binaries for
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index bee2b99..76986d5 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 
 all:	hello.c32 resolv.c32 serialinfo.c32 \
 	localboot.c32 \
diff --git a/com32/sysdump/Makefile b/com32/sysdump/Makefile
index bffee3a..e2528f7 100644
--- a/com32/sysdump/Makefile
+++ b/com32/sysdump/Makefile
@@ -16,7 +16,8 @@
 ##
 
 topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
 -include $(topdir)/version.mk
 
 LIBS	   = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
diff --git a/com32/tools/Makefile b/com32/tools/Makefile
index e34296b..7badabd 100644
--- a/com32/tools/Makefile
+++ b/com32/tools/Makefile
@@ -10,8 +10,8 @@
 ##
 ## -----------------------------------------------------------------------
 
-topdir = ../..
-include $(topdir)/MCONFIG.build
+MAKEDIR = ../../mk
+include $(MAKEDIR)/build.mk
 
 BINS    = relocs
 
diff --git a/core/Makefile b/core/Makefile
index 33ad7e9..9695892 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -20,7 +20,8 @@ MAKEFLAGS += -r
 MAKE      += -r
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 -include $(topdir)/version.mk
 
 OPTFLAGS =
diff --git a/diag/geodsp/Makefile b/diag/geodsp/Makefile
index 4c8eff6..04fd89e 100644
--- a/diag/geodsp/Makefile
+++ b/diag/geodsp/Makefile
@@ -19,7 +19,7 @@
 #
 
 topdir = ../..
-# include $(topdir)/MCONFIG.embedded
+# include $(topdir)/mk/embedded.mk
 coredir = $(topdir)/core
 
 BTARGET = geodsp1s.bin geodspms.bin mk-lba-img \
diff --git a/diag/mbr/Makefile b/diag/mbr/Makefile
index a94253a..79ff9f0 100644
--- a/diag/mbr/Makefile
+++ b/diag/mbr/Makefile
@@ -17,7 +17,8 @@
 
 topdir = ../..
 mbrdir = $(topdir)/mbr
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 
 all:	handoff.bin
 
diff --git a/dos/Makefile b/dos/Makefile
index 2667de8..5e5fc63 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 
 CFLAGS	+= -D__MSDOS__
 # CFLAGS  += -DDEBUG
diff --git a/dosutil/Makefile b/dosutil/Makefile
index fc10ff9..5746e86 100644
--- a/dosutil/Makefile
+++ b/dosutil/Makefile
@@ -2,7 +2,8 @@
 # OpenWatcom compile and link utility
 #
 topdir = ..
-include $(topdir)/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/syslinux.mk
 
 WCL	= wcl
 WCLOPT	= -6 -osx -mt -bt=DOS -l=COM
diff --git a/extlinux/Makefile b/extlinux/Makefile
index 83cf1a5..5da19e4 100644
--- a/extlinux/Makefile
+++ b/extlinux/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ..
-include $(topdir)/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/syslinux.mk
 
 OPTFLAGS = -g -Os
 INCLUDES = -I. -I.. -I../libinstaller
diff --git a/linux/Makefile b/linux/Makefile
index ffe2272..b9dac17 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ..
-include $(topdir)/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/syslinux.mk
 
 OPTFLAGS = -g -O0 -Dalloca=malloc
 INCLUDES = -I. -I.. -I../libinstaller
diff --git a/lzo/Makefile b/lzo/Makefile
index d88279d..cf8f985 100644
--- a/lzo/Makefile
+++ b/lzo/Makefile
@@ -11,7 +11,8 @@
 ## -----------------------------------------------------------------------
 
 topdir = ..
-include $(topdir)/MCONFIG.build
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/build.mk
 
 INCLUDES += -I./include
 
diff --git a/mbr/Makefile b/mbr/Makefile
index c3eb97a..993bb10 100644
--- a/mbr/Makefile
+++ b/mbr/Makefile
@@ -16,7 +16,8 @@
 #
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 
 all:	mbr.bin   altmbr.bin   gptmbr.bin   isohdpfx.bin   isohdppx.bin \
 	mbr_c.bin altmbr_c.bin gptmbr_c.bin isohdpfx_c.bin isohdppx_c.bin \
diff --git a/memdisk/Makefile b/memdisk/Makefile
index 92f565a..5475b44 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -12,7 +12,8 @@
 ## -----------------------------------------------------------------------
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 -include $(topdir)/version.mk
 
 INCLUDES = -I$(topdir)/com32/include
diff --git a/memdump/Makefile b/memdump/Makefile
index e56c7bd..6a30431 100644
--- a/memdump/Makefile
+++ b/memdump/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 
 OPTFLAGS = 
 INCLUDES = -include code16.h -I.
diff --git a/MCONFIG.build b/mk/build.mk
similarity index 97%
rename from MCONFIG.build
rename to mk/build.mk
index d1abff2..0ca82be 100644
--- a/MCONFIG.build
+++ b/mk/build.mk
@@ -14,7 +14,7 @@
 ## Right now we don't distinguish between "build" system and the "host"
 ## system, although we really should...
 ##
-include $(topdir)/MCONFIG
+include $(MAKEDIR)/syslinux.mk
 
 OPTFLAGS   = -g -Os
 INCLUDES   =
diff --git a/com32/MCONFIG b/mk/com32.mk
similarity index 98%
rename from com32/MCONFIG
rename to mk/com32.mk
index a74ed32..4a6caae 100644
--- a/com32/MCONFIG
+++ b/mk/com32.mk
@@ -15,7 +15,7 @@
 ## COM32 common configurables
 ##
 
-include $(topdir)/MCONFIG
+include $(MAKEDIR)/syslinux.mk
 
 GCCOPT := $(call gcc_ok,-std=gnu99,)
 GCCOPT += $(call gcc_ok,-m32,)
diff --git a/MCONFIG.devel b/mk/devel.mk
similarity index 100%
rename from MCONFIG.devel
rename to mk/devel.mk
diff --git a/MCONFIG.embedded b/mk/embedded.mk
similarity index 98%
rename from MCONFIG.embedded
rename to mk/embedded.mk
index 9f5846d..e8f3ae3 100644
--- a/MCONFIG.embedded
+++ b/mk/embedded.mk
@@ -14,7 +14,7 @@
 ## Make configuration for embedded directories
 ##
 
-include $(topdir)/MCONFIG
+include $(MAKEDIR)/syslinux.mk
 
 GCCOPT    := $(call gcc_ok,-m32,)
 GCCOPT    += $(call gcc_ok,-ffreestanding,)
diff --git a/com32/lib/MCONFIG b/mk/lib.mk
similarity index 98%
rename from com32/lib/MCONFIG
rename to mk/lib.mk
index 44278bd..48b2a13 100644
--- a/com32/lib/MCONFIG
+++ b/mk/lib.mk
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 
-include $(topdir)/MCONFIG
+include $(MAKEDIR)/syslinux.mk
 
 GCCOPT := $(call gcc_ok,-std=gnu99,)
 GCCOPT += $(call gcc_ok,-m32,)
diff --git a/com32/rosh/MCONFIG b/mk/rosh.mk
similarity index 97%
rename from com32/rosh/MCONFIG
rename to mk/rosh.mk
index 25c4139..7fdba0f 100644
--- a/com32/rosh/MCONFIG
+++ b/mk/rosh.mk
@@ -15,7 +15,7 @@
 ##
 
 ## Include the COM32 common configurables
-include ../MCONFIG
+include $(MAKEDIR)/com32.mk
 
 # CFLAGS     = $(GCCOPT) $(GCCWARN) -march=i386 \
 # 	     -fomit-frame-pointer -D__COM32__ \
diff --git a/MCONFIG b/mk/syslinux.mk
similarity index 96%
rename from MCONFIG
rename to mk/syslinux.mk
index a71fd13..2d47f81 100644
--- a/MCONFIG
+++ b/mk/syslinux.mk
@@ -77,7 +77,7 @@ UMAKEDEPS = -Wp,-MT,$@,-MMD,$(dir $@).$(notdir $@).d
 
 # Items that are only appropriate during development; this file is
 # removed when tarballs are generated.
--include $(topdir)/MCONFIG.devel
+-include $(makefiledir)/devel.mk
 
 # Local additions, like -DDEBUG can go here
--include $(topdir)/MCONFIG.local
+-include $(makefiledir)/local.mk
diff --git a/modules/Makefile b/modules/Makefile
index 9b50bb2..f878c70 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 
 INCLUDES   = -I$(com32)/include
 
diff --git a/mtools/Makefile b/mtools/Makefile
index 6164d24..04e9d7d 100755
--- a/mtools/Makefile
+++ b/mtools/Makefile
@@ -1,5 +1,6 @@
 topdir = ..
-include $(topdir)/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/syslinux.mk
 
 OPTFLAGS = -g -Os
 INCLUDES = -I. -I.. -I../libfat -I../libinstaller
diff --git a/sample/Makefile b/sample/Makefile
index d7f439c..9e504d9 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -15,7 +15,8 @@
 ##
 
 topdir = ..
-include $(topdir)/MCONFIG.embedded
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/embedded.mk
 
 PPMTOLSS16 = $(topdir)/utils/ppmtolss16
 
diff --git a/utils/Makefile b/utils/Makefile
index 455eb82..eed07bb 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -15,7 +15,8 @@
 #
 
 topdir = ..
-include $(topdir)/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/syslinux.mk
 
 CFLAGS   = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
 LDFLAGS  = -O2 -s
-- 
1.7.4.2




More information about the Syslinux mailing list