summaryrefslogtreecommitdiff
path: root/mbr
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-08-20 15:15:34 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-08-20 15:15:34 -0700
commitbd09a6d828fa492aed4406adde6c412e0e5c640d (patch)
tree660a4813999ba273afb26fd3e137399cb0a57a97 /mbr
parent6aa3a1c8380276387430684eb39650e958b0030a (diff)
downloadsyslinux-bd09a6d828fa492aed4406adde6c412e0e5c640d.tar.gz
Major Makefile cleanups; gcc 4.3.0 compatiblity
Cleanup and centralize the Makefile system even more. Fix a gcc 4.3 incompatibility in memdisk (definition of strlen).
Diffstat (limited to 'mbr')
-rw-r--r--mbr/Makefile17
1 files changed, 7 insertions, 10 deletions
diff --git a/mbr/Makefile b/mbr/Makefile
index d479265c..6ae63719 100644
--- a/mbr/Makefile
+++ b/mbr/Makefile
@@ -14,19 +14,16 @@
# Makefile for MBR
#
-TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+topdir = ..
+include $(topdir)/MCONFIG
-gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
- then echo $(1); else echo $(2); fi; rm -f $$tmpf)
+GCCOPT := $(call gcc_ok,-m32,) \
+ $(call gcc_ok,-ffreestanding,) \
+ $(call gcc_ok,-fno-stack-protector) \
+ -march=i386 -Os
-M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector)
-
-CC = gcc
-LD = ld
LDFLAGS = -m elf_i386
-SFLAGS = $(M32) -march=i386
-OBJCOPY = objcopy
-PERL = perl
+SFLAGS = $(GCCOPT)
.SUFFIXES: .S .s .o .elf