From b8f63328eb3061c23fd748964662f72220b408f6 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 6 Apr 2009 16:33:43 -0700 Subject: [PATCH] Makefiles: try to make "make install" do the right thing One more attempt at getting semi-sanity to "make install". Realistically, the install/netinstall/install-all/... needs to be pushed into the com32 Makefiles, but this is at least a quick hack. Signed-off-by: H. Peter Anvin --- Makefile | 4 +-- com32/gdbstub/Makefile | 2 +- com32/gpllib/Makefile | 2 +- com32/hdt/Makefile | 78 ++++++++++++++------------------------------------ com32/lib/Makefile | 2 +- com32/libutil/Makefile | 2 +- com32/menu/Makefile | 2 +- com32/modules/Makefile | 2 +- com32/rosh/Makefile | 2 +- 9 files changed, 31 insertions(+), 65 deletions(-) diff --git a/Makefile b/Makefile index 2626baf..4520c35 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,8 @@ include $(topdir)/MCONFIG # List of module objects that should be installed for all derivatives MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \ - com32/menu/*.c32 com32/modules/*.c32 com32/hdt/*.c32 - + com32/menu/*.c32 com32/modules/*.c32 com32/hdt/*.c32 \ + com32/rosh/*.c32 # syslinux.exe is BTARGET so as to not require everyone to have the # mingw suite installed diff --git a/com32/gdbstub/Makefile b/com32/gdbstub/Makefile index 2c9171e..5513876 100644 --- a/com32/gdbstub/Makefile +++ b/com32/gdbstub/Makefile @@ -42,7 +42,7 @@ spotless: clean rm -f *.lss *.c32 *.com rm -f *~ \#* -install: all +install: mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR) install -m 644 $(MODULES) $(INSTALLROOT)$(AUXDIR) diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile index 46ed42e..80138cf 100644 --- a/com32/gpllib/Makefile +++ b/com32/gpllib/Makefile @@ -36,7 +36,7 @@ spotless: clean # Mixing in the GPL include files is suboptimal, but I'm not sure # there is a better way to do it. -install: all +install: mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR) install -m 644 libcom32gpl.a $(INSTALLROOT)$(COM32DIR) mkdir -p $(INSTALLROOT)$(COM32DIR)/include/ diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile index 4056c76..8f8cae2 100644 --- a/com32/hdt/Makefile +++ b/com32/hdt/Makefile @@ -1,81 +1,47 @@ ## ----------------------------------------------------------------------- ## -## Copyright 2001-2009 H. Peter Anvin - All Rights Reserved +## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved ## Copyright 2009 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 -## the Free Software Foundation, Inc., 53 Temple Place Ste 330, -## Boston MA 02111-1307, USA; either version 2 of the License, or +## the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +## Boston MA 02110-1301, USA; either version 2 of the License, or ## (at your option) any later version; incorporated herein by reference. ## ## ----------------------------------------------------------------------- ## -## samples for syslinux users +## Hardware Detection Tool ## topdir = ../.. -include $(topdir)/MCONFIG.embedded +include ../MCONFIG -MODULES = hdt.c32 +LIBS = ../cmenu/libmenu/libmenu.a ../libutil/libutil_com.a \ + ../lib/libcom32.a $(LIBGCC) +CFLAGS += -I$(com32)/cmenu/libmenu -INCLUDES = -I$(com32)/include -I$(com32)/cmenu/libmenu -I$(com32)/gplinclude\ - -I$(com32)/libutil/include +MODULES = hdt.c32 +TESTFILES = -LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) -LIB = liboldcom32.a +OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) -com32 = $(topdir)/com32 -LIBS = $(LIB) $(com32)/cmenu/libmenu/libmenu.a \ - $(com32)/gpllib/libcom32gpl.a \ - $(com32)/libutil/libutil_com.a $(com32)/lib/libcom32.a \ - $(LIBGCC) +all: $(MODULES) $(TESTFILES) -LDFLAGS = -m elf_i386 -T $(com32)/lib/com32.ld - -all: $(MODULES) $(LIB) - -.PRECIOUS: %.o -%.o: %.S - $(CC) $(SFLAGS) -c -o $@ $< - -.PRECIOUS: %.o -%.o: %.c - @$(CC) $(CFLAGS) -std=gnu99 -D__COM32__ -c -o $@ $< - -.PRECIOUS: %.elf -%.elf: c32entry.o %.o $(LIB) - @$(LD) -Ttext 0x101000 -e _start -o $@ $^ - -hdt.elf: hdt.o hdt-ata.o hdt-menu.o hdt-menu-pci.o hdt-menu-kernel.o \ - hdt-menu-disk.o hdt-menu-dmi.o hdt-menu-processor.o \ - hdt-menu-syslinux.o hdt-menu-about.o \ - hdt-cli.o hdt-common.o hdt-cli-pci.o hdt-cli-dmi.o \ - hdt-cli-cpu.o hdt-cli-pxe.o hdt-cli-kernel.o \ - hdt-cli-syslinux.o hdt-cli-vesa.o\ - hdt-menu-pxe.o hdt-menu-summary.o hdt-menu-vesa.o\ - $(LIBS) - @$(LD) $(LDFLAGS) -o $@ $^ - -%.c32: %.elf - @$(OBJCOPY) -O binary $< $@ - -%.com: %.asm - @$(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $< - -$(LIB): - @rm -f $@ - @$(AR) cq $@ $^ - @$(RANLIB) $@ +hdt.elf : $(OBJS) $(LIBS) $(C_LIBS) + $(LD) $(LDFLAGS) -o $@ $^ tidy dist: - @rm -f *.o *.a *.lst *.elf - -install: all + rm -f *.o *.lo *.a *.lst *.elf .*.d *.tmp -# Don't specify *.com since mdiskchk.com can't be built using Linux tools clean: tidy - @rm -f *.o *.c32 *.c~ *.h~ Makefile~ + rm -f *.lnx spotless: clean + rm -f *.lss *.c32 *.com + rm -f *~ \#* + +install: + +-include .*.d diff --git a/com32/lib/Makefile b/com32/lib/Makefile index 984c6df..0c4f095 100644 --- a/com32/lib/Makefile +++ b/com32/lib/Makefile @@ -128,7 +128,7 @@ spotless: clean rm -f *.a rm -f *~ \#* */*~ */\#* -install: all +install: mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR) install -m 644 libcom32.a com32.ld $(INSTALLROOT)$(COM32DIR) -rm -rf $(INSTALLROOT)$(COM32DIR)/include diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile index 02789ca..579f6f2 100644 --- a/com32/libutil/Makefile +++ b/com32/libutil/Makefile @@ -58,7 +58,7 @@ spotless: clean rm -f *.lss *.a *.c32 *.com rm -f *~ \#* -install: all +install: mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR) install -m 644 libutil_com.a libutil_lnx.a $(INSTALLROOT)$(COM32DIR) diff --git a/com32/menu/Makefile b/com32/menu/Makefile index d6293bb..2a03272 100644 --- a/com32/menu/Makefile +++ b/com32/menu/Makefile @@ -44,6 +44,6 @@ spotless: clean rm -f *.lss *.c32 *.com rm -f *~ \#* -install: all +install: -include .*.d diff --git a/com32/modules/Makefile b/com32/modules/Makefile index 764737d..f008963 100644 --- a/com32/modules/Makefile +++ b/com32/modules/Makefile @@ -53,6 +53,6 @@ spotless: clean rm -f *.lss *.c32 *.com rm -f *~ \#* -install: all +install: -include .*.d diff --git a/com32/rosh/Makefile b/com32/rosh/Makefile index 30dc7d3..3895cd8 100644 --- a/com32/rosh/Makefile +++ b/com32/rosh/Makefile @@ -33,6 +33,6 @@ spotless: clean rm -f *.lss *.c32 *.com rm -f *~ \#* -install: # Don't install samples +install: -include .*.d -- 2.7.4