From: H. Peter Anvin Date: Fri, 22 Aug 2008 21:42:40 +0000 (-0700) Subject: Clean up embedded Makefile targets; fix build failure X-Git-Tag: syslinux-3.72-pre1~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22a37e436ec3b84ba6dadb44952b0535f96a213c;p=platform%2Fupstream%2Fsyslinux.git Clean up embedded Makefile targets; fix build failure Unify common pieces to "embedded" targets (those that produce code that runs neither in the host nor in a com32 environment); this fixes the broken sample/ directory Makefile. --- diff --git a/MCONFIG b/MCONFIG index 6919ce7..9900ac4 100644 --- a/MCONFIG +++ b/MCONFIG @@ -50,3 +50,5 @@ NM = nm RANLIB = ranlib GZIPPROG = gzip PNGTOPNM = pngtopnm + +com32 = $(topdir)/com32 diff --git a/MCONFIG.embedded b/MCONFIG.embedded new file mode 100644 index 0000000..fee374f --- /dev/null +++ b/MCONFIG.embedded @@ -0,0 +1,35 @@ +## -*- makefile -*- ------------------------------------------------------ +## +## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved +## +## 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 +## (at your option) any later version; incorporated herein by reference. +## +## ----------------------------------------------------------------------- + +## +## Make configuration for embedded directories +## + +include $(topdir)/MCONFIG + +GCCOPT := $(call gcc_ok,-m32,) \ + $(call gcc_ok,-ffreestanding,) \ + $(call gcc_ok,-fno-stack-protector,) \ + $(call gcc_ok,-falign-functions=0,-malign-functions=0) \ + $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \ + $(call gcc_ok,-falign-loops=0,-malign-loops=0) \ + -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \ + -msoft-float + +LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) + +LD += -m elf_i386 +CFLAGS = $(GCCOPT) -g -W -Wall $(OPTFLAGS) $(INCLUDES) +SFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +.SUFFIXES: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss + diff --git a/com32/menu/Makefile b/com32/menu/Makefile index 73cf586..cfdea06 100644 --- a/com32/menu/Makefile +++ b/com32/menu/Makefile @@ -28,10 +28,10 @@ COMMONOBJS = menumain.o readconfig.o passwd.o printmsg.o colors.o \ all: $(MODULES) $(TESTFILES) -menu.elf : menu.o $(COMMONOBJS) $(LIBS) +menu.elf : menu.o $(COMMONOBJS) $(LIBS) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ -vesamenu.elf : vesamenu.o $(COMMONOBJS) $(LIBS) +vesamenu.elf : vesamenu.o $(COMMONOBJS) $(LIBS) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ tidy dist: diff --git a/com32/modules/Makefile b/com32/modules/Makefile index 2f6fb25..691e929 100644 --- a/com32/modules/Makefile +++ b/com32/modules/Makefile @@ -25,16 +25,16 @@ TESTFILES = all: $(MODULES) $(TESTFILES) -pcitest.elf : pcitest.o $(LIBS) +pcitest.elf : pcitest.o $(LIBS) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ -cpuidtest.elf : cpuidtest.o cpuid.o $(LIBS) +cpuidtest.elf : cpuidtest.o cpuid.o $(LIBS) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ -dmitest.elf : dmitest.o dmi_utils.o dmi.o $(LIBS) +dmitest.elf : dmitest.o dmi_utils.o dmi.o $(LIBS) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ -ethersel.elf : ethersel.o $(LIBS) +ethersel.elf : ethersel.o $(LIBS) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ tidy dist: diff --git a/dos/Makefile b/dos/Makefile index 028e833..da73a6d 100644 --- a/dos/Makefile +++ b/dos/Makefile @@ -15,24 +15,12 @@ ## topdir = .. -include $(topdir)/MCONFIG +include $(topdir)/MCONFIG.embedded -GCCOPT := $(call gcc_ok,-m32,) \ - $(call gcc_ok,-ffreestanding,) \ - $(call gcc_ok,-fno-stack-protector,) \ - $(call gcc_ok,-falign-functions=0,-malign-functions=0) \ - $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \ - $(call gcc_ok,-falign-loops=0,-malign-loops=0) \ - -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \ - -msoft-float - -LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) - -LDFLAGS = -m elf_i386 -T com16.ld +LDFLAGS = -T com16.ld OPTFLAGS = -g INCLUDES = -include code16.h -nostdinc -iwithprefix include \ -I. -I.. -I../libfat -I ../libinstaller -CFLAGS = $(GCCOPT) -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES) SRCS = syslinux.c \ ../libinstaller/syslxmod.c \ @@ -44,8 +32,6 @@ OBJS = crt0.o $(patsubst %.c,%.o,$(notdir $(SRCS))) LIBOBJS = conio.o memcpy.o memset.o skipatou.o atou.o malloc.o free.o \ argv.o printf.o __divdi3.o __udivmoddi4.o -.SUFFIXES: .c .o .i .s .S .elf .com .asm .lst - VPATH = .:../libfat:../libinstaller TARGETS = syslinux.com copybs.com diff --git a/mbr/Makefile b/mbr/Makefile index 6ae6371..7952e60 100644 --- a/mbr/Makefile +++ b/mbr/Makefile @@ -15,17 +15,7 @@ # topdir = .. -include $(topdir)/MCONFIG - -GCCOPT := $(call gcc_ok,-m32,) \ - $(call gcc_ok,-ffreestanding,) \ - $(call gcc_ok,-fno-stack-protector) \ - -march=i386 -Os - -LDFLAGS = -m elf_i386 -SFLAGS = $(GCCOPT) - -.SUFFIXES: .S .s .o .elf +include $(topdir)/MCONFIG.embedded all: mbr.bin gptmbr.bin diff --git a/memdisk/Makefile b/memdisk/Makefile index 66a6e51..d3023a0 100644 --- a/memdisk/Makefile +++ b/memdisk/Makefile @@ -11,28 +11,17 @@ ## ----------------------------------------------------------------------- topdir = .. -include $(topdir)/MCONFIG +include $(topdir)/MCONFIG.embedded -include $(topdir)/version.mk -GCCOPT := $(call gcc_ok,-m32,) \ - $(call gcc_ok,-ffreestanding,) \ - $(call gcc_ok,-fno-stack-protector) \ - $(call gcc_ok,-falign-functions=0,-malign-functions=0) \ - $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \ - $(call gcc_ok,-falign-loops=0,-malign-loops=0) \ - -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 - CFLAGS = $(GCCOPT) -g -W -Wall -Wno-sign-compare -DDATE='"$(DATE)"' SFLAGS = $(GCCOPT) -D__ASSEMBLY__ LDFLAGS = $(GCCOPT) -g INCLUDE = -I$(topdir)/com32/include -LD += -m elf_i386 NASM = nasm NASMOPT = -O9999 NFLAGS = -dDATE='"$(DATE)"' -dWITH_EDD NINCLUDE = -OBJCOPY = objcopy -PERL = perl SRCS = $(wildcard *.asm *.c *.h) diff --git a/memdump/Makefile b/memdump/Makefile index 4467723..6696020 100644 --- a/memdump/Makefile +++ b/memdump/Makefile @@ -15,21 +15,10 @@ ## topdir = .. -include $(topdir)/MCONFIG - -GCCOPT := $(call gcc_ok,-m32,) \ - $(call gcc_ok,-ffreestanding,) \ - $(call gcc_ok,-fno-stack-protector,) \ - $(call gcc_ok,-falign-functions=0,-malign-functions=0) \ - $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \ - $(call gcc_ok,-falign-loops=0,-malign-loops=0) \ - -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \ - -msoft-float - -LD += -m elf_i386 -OPTFLAGS = -g +include $(topdir)/MCONFIG.embedded + +OPTFLAGS = INCLUDES = -include code16.h -I. -CFLAGS = $(GCCOPT) -W -Wall $(OPTFLAGS) $(INCLUDES) LDFLAGS = -T com16.ld SRCS = main.c serial.c ymsend.c diff --git a/sample/Makefile b/sample/Makefile index d9df458..8560b3e 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -15,19 +15,15 @@ ## topdir = .. -include $(topdir)/MCONFIG +include $(topdir)/MCONFIG.embedded + +INCLUDES = -I$(com32)/include -LD += -m elf_i386 -CFLAGS = $(GCCOPT) -W -Wall -I$(topdir)/com32/include -SFLAGS = $(GCCOPT) -LDFLAGS = -s PPMTOLSS16 = $(topdir)/utils/ppmtolss16 LIB = liboldcom32.a LIBOBJS = conio.o atou.o skipatou.o printf.o c32exit.o -.SUFFIXES: .lss .c .o .elf .c32 - all: syslogo.lss comecho.com hello.c32 hello2.c32 filetest.c32 c32echo.c32 \ fd.c32 $(LIB)