Merge remote-tracking branch 'genec/gpxelinux-kpxe-for-hpa'
[profile/ivi/syslinux.git] / diag / geodsp / Makefile
1 ## -----------------------------------------------------------------------
2 ##
3 ##   Copyright 2010-2011 Gene Cumm
4 ##
5 ##   Portions from core/Makefile:
6 ##   Copyright 1998-2009 H. Peter Anvin - All Rights Reserved
7 ##   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
8 ##
9 ##   This program is free software; you can redistribute it and/or modify
10 ##   it under the terms of the GNU General Public License as published by
11 ##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
12 ##   Boston MA 02111-1307, USA; either version 2 of the License, or
13 ##   (at your option) any later version; incorporated herein by reference.
14 ##
15 ## -----------------------------------------------------------------------
16
17 #
18 # Makefile for the SYSLINUX geometry display for diagnostics
19 #
20
21 topdir = ../..
22 # include $(topdir)/MCONFIG.embedded
23 coredir = $(topdir)/core
24
25 BTARGET = geodsp1s.bin geodspms.bin mk-lba-img \
26         geodsp1s.img.xz geodspms.img.xz
27 #       lba-1s.img.xz lba-ms.img.xz
28   # lba-1s.img lba-ms.img
29
30 NASMOPT = -i $(coredir)/ -Ox -f bin
31 NASMOPT += -w+orphan-labels
32
33 all: $(BTARGET)
34
35 .PRECIOUS: %.img
36 # .PRECIOUS: lba-%.img
37
38 # Higher compression levels result in larger files
39 %.img.xz: %.img
40         xz -k0f $<
41
42 %.img.gz: %.img
43         gzip -9c $< > $@
44
45 %.img: %.bin lba.img
46         (cp -a lba.img $@ && dd conv=notrunc if=$< of=$@) || rm -f $@
47
48 %.bin: %.asm $(coredir)/writehex.inc $(coredir)/macros.inc $(coredir)/diskboot.inc
49         nasm $(NASMOPT) -o $@ -l $(@:.bin=.lst) $<
50
51 mk-lba-img: mk-lba-img.c
52         gcc -o $@ $<
53
54 lba.img: mk-lba-img
55         ./$< $@
56
57 tidy dist:
58         rm -Rf *.img
59
60 clean: tidy
61         rm -f $(BTARGET) *.lst *.bin *_bin.c
62
63 spotless: clean