1 | ## ----------------------------------------------------------------------- |
---|
2 | ## |
---|
3 | ## Copyright 2001-2009 H. Peter Anvin - All Rights Reserved |
---|
4 | ## Copyright 2009 Intel Corporation; author: H. Peter Anvin |
---|
5 | ## |
---|
6 | ## This program is free software; you can redistribute it and/or modify |
---|
7 | ## it under the terms of the GNU General Public License as published by |
---|
8 | ## the Free Software Foundation, Inc., 53 Temple Place Ste 330, |
---|
9 | ## Boston MA 02111-1307, USA; either version 2 of the License, or |
---|
10 | ## (at your option) any later version; incorporated herein by reference. |
---|
11 | ## |
---|
12 | ## ----------------------------------------------------------------------- |
---|
13 | |
---|
14 | VPATH = $(SRC) |
---|
15 | include $(MAKEDIR)/elf.mk |
---|
16 | |
---|
17 | MODULES = gfxboot.c32 |
---|
18 | |
---|
19 | all: $(MODULES) |
---|
20 | |
---|
21 | OBJS = gfxboot.o realmode_callback.o |
---|
22 | |
---|
23 | gfxboot.elf : $(OBJS) $(LIBS) $(C_LIBS) |
---|
24 | $(LD) $(LDFLAGS) -o $@ $^ |
---|
25 | |
---|
26 | realmode_callback.o: realmode_callback.asm |
---|
27 | ifeq ($(ARCH),i386) |
---|
28 | $(NASM) -f bin -O99 -o $*.tmp -l $*.lst $< |
---|
29 | $(OBJCOPY) -B i386 -I binary -O elf32-i386 \ |
---|
30 | --redefine-sym _binary_$*_tmp_start=$*_start \ |
---|
31 | --redefine-sym _binary_$*_tmp_end=$*_end \ |
---|
32 | --strip-symbol _binary_$*_tmp_size \ |
---|
33 | $*.tmp $@ |
---|
34 | endif |
---|
35 | ifeq ($(ARCH),x86_64) |
---|
36 | $(NASM) -f bin -O99 -o $*.tmp -l $*.lst $< |
---|
37 | $(OBJCOPY) -B i386:x86-64 -I binary -O elf64-x86-64 \ |
---|
38 | --redefine-sym _binary_$*_tmp_start=$*_start \ |
---|
39 | --redefine-sym _binary_$*_tmp_end=$*_end \ |
---|
40 | --strip-symbol _binary_$*_tmp_size \ |
---|
41 | $*.tmp $@ |
---|
42 | endif |
---|
43 | |
---|
44 | tidy dist: |
---|
45 | rm -f *.o *.lo *.a *.lst .*.d *.tmp |
---|
46 | |
---|
47 | clean: tidy |
---|
48 | rm -f *.lnx |
---|
49 | |
---|
50 | spotless: clean |
---|
51 | rm -f *.lss *.c32 *.com |
---|
52 | rm -f *~ \#* |
---|
53 | |
---|
54 | install: |
---|
55 | |
---|
56 | -include .*.d |
---|