4 # Leendert van Doorn, leendert@watson.ibm.com
5 # Copyright (c) 2005, International Business Machines Corporation.
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms and conditions of the GNU General Public License,
9 # version 2, as published by the Free Software Foundation.
11 # This program is distributed in the hope it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 # You should have received a copy of the GNU General Public License along with
17 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 # Place - Suite 330, Boston, MA 02111-1307 USA.
21 # External CFLAGS can do more harm than good.
25 # The emulator code lives in ROM space
28 DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR)
30 # Disable PIE/SSP if GCC supports them. They can break us.
31 CFLAGS += $(call cc-option,$(CC),-nopie,)
32 CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
33 CFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
36 OBJCOPY = objcopy -p -O binary -R .note -R .comment -R .bss -S --gap-fill=0
37 CFLAGS += $(DEFINES) -I. -fno-builtin -O2 -msoft-float
40 OBJECTS = head.o trap.o vm86.o setup.o util.o
45 vmxassist.bin: vmxassist.ld $(OBJECTS)
46 $(CPP) $(DEFINES) vmxassist.ld > vmxassist.tmp
47 $(LD) -o vmxassist $(LDFLAGS) -nostdlib --fatal-warnings -N -T vmxassist.tmp $(OBJECTS)
48 nm -n vmxassist > vmxassist.sym
49 $(OBJCOPY) vmxassist vmxassist.tmp
50 dd if=vmxassist.tmp of=vmxassist.bin ibs=512 conv=sync
53 head.o: machine.h vm86.h head.S
54 $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c head.S
56 trap.o: machine.h vm86.h offsets.h trap.S
57 $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c trap.S
59 vm86.o: machine.h vm86.h vm86.c
60 $(CC) $(CFLAGS) -c vm86.c
62 setup.o: machine.h vm86.h setup.c
63 $(CC) $(CFLAGS) -c setup.c
65 util.o: machine.h vm86.h util.c
66 $(CC) $(CFLAGS) -c util.c
72 $(CC) $(CFLAGS) -I. -o gen gen.c
76 rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s
78 rm -f gen gen.o offsets.h