| 1 |
XEN_ROOT = $(CURDIR)/../../.. |
| 2 |
include $(XEN_ROOT)/Config.mk |
| 3 |
|
| 4 |
CC = gcc |
| 5 |
|
| 6 |
GCC = gcc |
| 7 |
BCC = bcc |
| 8 |
AS86 = as86 |
| 9 |
|
| 10 |
RELEASE = `pwd | sed "s-.*/--"` |
| 11 |
VGABIOS_REL_DATE ?= $(call date,"+%d %b %Y") |
| 12 |
RELVERS = `pwd | sed "s-.*/--" | sed "s/vgabios//" | sed "s/-//"` |
| 13 |
|
| 14 |
VGABIOS_DATE = "-DVGABIOS_DATE=\"$(VGABIOS_REL_DATE)\"" |
| 15 |
|
| 16 |
.PHONY: all |
| 17 |
all: bios cirrus-bios |
| 18 |
|
| 19 |
.PHONY: bios |
| 20 |
bios: biossums vgabios.bin vgabios.debug.bin |
| 21 |
|
| 22 |
.PHONY: cirrus-bios |
| 23 |
cirrus-bios: vgabios-cirrus.bin vgabios-cirrus.debug.bin |
| 24 |
|
| 25 |
.PHONY: clean |
| 26 |
clean: |
| 27 |
rm -f biossums vbetables-gen vbetables.h *.o *.s *.ld86 \ |
| 28 |
temp.awk.* vgabios*.orig _vgabios_* _vgabios-debug_* core vgabios*.bin vgabios*.txt $(RELEASE).bin *.bak |
| 29 |
rm -f VGABIOS-lgpl-latest*.bin |
| 30 |
|
| 31 |
.PHONY: distclean |
| 32 |
distclean: clean |
| 33 |
|
| 34 |
.PHONY: release |
| 35 |
release: |
| 36 |
VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios |
| 37 |
/bin/rm -f *.o *.s *.ld86 \ |
| 38 |
temp.awk.* vgabios.*.orig _vgabios_.*.c core *.bak .#* |
| 39 |
cp VGABIOS-lgpl-latest.bin ../$(RELEASE).bin |
| 40 |
cp VGABIOS-lgpl-latest.debug.bin ../$(RELEASE).debug.bin |
| 41 |
cp VGABIOS-lgpl-latest.cirrus.bin ../$(RELEASE).cirrus.bin |
| 42 |
cp VGABIOS-lgpl-latest.cirrus.debug.bin ../$(RELEASE).cirrus.debug.bin |
| 43 |
tar czvf ../$(RELEASE).tgz --exclude CVS -C .. $(RELEASE)/ |
| 44 |
|
| 45 |
vgabios.bin: biossums vgabios.c vgabios.h vgafonts.h vgatables.h vbe.h vbe.c vbetables.h |
| 46 |
$(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DVBE $(VGABIOS_DATE) > _vgabios_.c |
| 47 |
$(BCC) -o vgabios.s -C-c -D__i86__ -S -0 _vgabios_.c |
| 48 |
sed -e 's/^\.text//' -e 's/^\.data//' vgabios.s > _vgabios_.s |
| 49 |
$(AS86) _vgabios_.s -b vgabios.bin -u -w- -g -0 -j -O -l vgabios.txt |
| 50 |
rm -f _vgabios_.s _vgabios_.c vgabios.s |
| 51 |
cp vgabios.bin VGABIOS-lgpl-latest.bin |
| 52 |
./biossums VGABIOS-lgpl-latest.bin |
| 53 |
ls -l VGABIOS-lgpl-latest.bin |
| 54 |
|
| 55 |
vgabios.debug.bin: biossums vgabios.c vgabios.h vgafonts.h vgatables.h vbe.h vbe.c vbetables.h |
| 56 |
$(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DVBE -DDEBUG $(VGABIOS_DATE) > _vgabios-debug_.c |
| 57 |
$(BCC) -o vgabios-debug.s -C-c -D__i86__ -S -0 _vgabios-debug_.c |
| 58 |
sed -e 's/^\.text//' -e 's/^\.data//' vgabios-debug.s > _vgabios-debug_.s |
| 59 |
$(AS86) _vgabios-debug_.s -b vgabios.debug.bin -u -w- -g -0 -j -O -l vgabios.debug.txt |
| 60 |
rm -f _vgabios-debug_.s _vgabios-debug_.c vgabios-debug.s |
| 61 |
cp vgabios.debug.bin VGABIOS-lgpl-latest.debug.bin |
| 62 |
./biossums VGABIOS-lgpl-latest.debug.bin |
| 63 |
ls -l VGABIOS-lgpl-latest.debug.bin |
| 64 |
|
| 65 |
vgabios-cirrus.bin: biossums vgabios.c vgabios.h vgafonts.h vgatables.h clext.c |
| 66 |
$(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DCIRRUS -DPCIBIOS $(VGABIOS_DATE) > _vgabios-cirrus_.c |
| 67 |
$(BCC) -o vgabios-cirrus.s -C-c -D__i86__ -S -0 _vgabios-cirrus_.c |
| 68 |
sed -e 's/^\.text//' -e 's/^\.data//' vgabios-cirrus.s > _vgabios-cirrus_.s |
| 69 |
$(AS86) _vgabios-cirrus_.s -b vgabios-cirrus.bin -u -w- -g -0 -j -O -l vgabios-cirrus.txt |
| 70 |
rm -f _vgabios-cirrus_.s _vgabios-cirrus_.c vgabios-cirrus.s |
| 71 |
cp vgabios-cirrus.bin VGABIOS-lgpl-latest.cirrus.bin |
| 72 |
./biossums VGABIOS-lgpl-latest.cirrus.bin |
| 73 |
ls -l VGABIOS-lgpl-latest.cirrus.bin |
| 74 |
|
| 75 |
vgabios-cirrus.debug.bin: biossums vgabios.c vgabios.h vgafonts.h vgatables.h clext.c |
| 76 |
$(GCC) -E -P vgabios.c $(VGABIOS_VERS) -DCIRRUS -DCIRRUS_DEBUG -DPCIBIOS $(VGABIOS_DATE) > _vgabios-cirrus-debug_.c |
| 77 |
$(BCC) -o vgabios-cirrus-debug.s -C-c -D__i86__ -S -0 _vgabios-cirrus-debug_.c |
| 78 |
sed -e 's/^\.text//' -e 's/^\.data//' vgabios-cirrus-debug.s > _vgabios-cirrus-debug_.s |
| 79 |
$(AS86) _vgabios-cirrus-debug_.s -b vgabios-cirrus.debug.bin -u -w- -g -0 -j -O -l vgabios-cirrus.debug.txt |
| 80 |
rm -f _vgabios-cirrus-debug_.s _vgabios-cirrus-debug_.c vgabios-cirrus-debug.s |
| 81 |
cp vgabios-cirrus.debug.bin VGABIOS-lgpl-latest.cirrus.debug.bin |
| 82 |
./biossums VGABIOS-lgpl-latest.cirrus.debug.bin |
| 83 |
ls -l VGABIOS-lgpl-latest.cirrus.debug.bin |
| 84 |
|
| 85 |
biossums: biossums.c |
| 86 |
$(CC) -o biossums biossums.c |
| 87 |
|
| 88 |
vbetables-gen: vbetables-gen.c |
| 89 |
$(CC) -o vbetables-gen vbetables-gen.c |
| 90 |
|
| 91 |
vbetables.h: vbetables-gen |
| 92 |
./vbetables-gen > $@ |