summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-01-22 22:16:31 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2014-01-22 22:16:31 -0800
commitab56e2507a699e5e24b5bb0dd2ec6826718428e1 (patch)
tree3e5897376c3d0f1980348126a9673d315c56ef1a
parent729b46714bbdfaed7adf46c54988d3ae58c6b67f (diff)
downloadtest16-ab56e2507a699e5e24b5bb0dd2ec6826718428e1.tar.gz
test16-ab56e2507a699e5e24b5bb0dd2ec6826718428e1.tar.xz
test16-ab56e2507a699e5e24b5bb0dd2ec6826718428e1.zip
Sanitize the Makefile a bit
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--Makefile20
-rw-r--r--code16gcc.h2
2 files changed, 18 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index e1eb9dc..2be6f81 100644
--- a/Makefile
+++ b/Makefile
@@ -2,10 +2,22 @@ CC = gcc
LD = ld
AR = ar
OBJCOPY = objcopy
-CFLAGS = -g -m32 -O2
-S16FLAGS = -g -m32 -mregparm=3 -D__ASSEMBLY__ -I include16
-C16FLAGS = -g -m32 -mregparm=3 -O2 -ffreestanding \
- -include code16gcc.h -I include16
+
+GCCWARN = -Wall -Wstrict-prototypes
+CFLAGS = -g -m32 -O2 $(GCCWARN)
+
+# Enable this if a real -m16 switch exists
+#M16 = -m16
+# Otherwise...
+M16 = -m32 -include code16gcc.h -fno-toplevel-reorder \
+ -fno-unit-at-a-time
+X16FLAGS = -g $(M16) -D__SYS16__ -I include16
+S16FLAGS = $(X16FLAGS) -D__ASSEMBLY__
+C16FLAGS = $(X16FLAGS) $(GCCWARN) -march=i386 -mregparm=3 \
+ -Os -ffreestanding \
+ -fno-stack-protector -mpreferred-stack-boundary=2 \
+ -fno-pic
+
LD16FLAGS = -m elf_i386 --section-start=.init=0x1000
LIB16S = $(wildcard lib16/*.S)
diff --git a/code16gcc.h b/code16gcc.h
index 0daca66..73bfab7 100644
--- a/code16gcc.h
+++ b/code16gcc.h
@@ -1 +1,3 @@
+#ifndef __ASSEMBLY__
asm(".code16gcc");
+#endif