Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Modified boot and vmxassist to handle real/protected transition.
[palacios.git] / bios / vmxassist / Makefile
1 #
2 # Makefile
3 #
4 # Leendert van Doorn, leendert@watson.ibm.com
5 # Copyright (c) 2005, International Business Machines Corporation.
6 #
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.
10 #
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
14 # more details.
15 #
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.
19 #
20
21 # External CFLAGS can do more harm than good.
22 CFLAGS := -m32
23
24
25 # The emulator code lives in ROM space
26 TEXTADDR=0x000D0000
27
28 DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR)
29
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,)
34
35 CPP      = cpp -P
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
38 LDFLAGS  = -m elf_i386
39
40 OBJECTS = head.o trap.o vm86.o setup.o util.o
41
42 .PHONY: all
43 all: vmxassist.bin
44
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
51         rm -f vmxassist.tmp
52
53 head.o: machine.h vm86.h head.S
54         $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c head.S
55
56 trap.o: machine.h vm86.h offsets.h trap.S
57         $(CC) $(CFLAGS) -D__ASSEMBLY__ $(DEFINES) -c trap.S
58
59 vm86.o: machine.h vm86.h vm86.c
60         $(CC) $(CFLAGS) -c vm86.c
61
62 setup.o: machine.h vm86.h setup.c
63         $(CC) $(CFLAGS) -c setup.c
64
65 util.o: machine.h vm86.h util.c
66         $(CC) $(CFLAGS) -c util.c
67
68 offsets.h: gen
69         ./gen > offsets.h
70
71 gen:    vm86.h gen.c
72         $(CC) $(CFLAGS) -I. -o gen gen.c
73
74 .PHONY: clean
75 clean:
76         rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s
77         rm -f $(OBJECTS)
78         rm -f gen gen.o offsets.h
79