initial import into code.google.com
[sgabios.git] / Makefile
1 # Copyright 2007 Google Inc.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15 # $Id: Makefile 110392 2008-02-26 00:59:11Z nil $
16
17 CFLAGS = -Wall -O2 -s
18
19 .SUFFIXES: .bin
20
21 all: sgabios.bin
22
23 sgabios.bin: sgabios.S version.h
24
25 version.h: Makefile sgabios.S
26 @echo '#define BIOS_BUILD_DATE "'`date -u +%D`'"' >version.h
27 @echo '#define BIOS_FULL_DATE "'`date -u`'"' >>version.h
28 @echo '#define BIOS_BUILD_HOST "'`echo $$LOGNAME@$$HOSTNAME`'"' >>version.h
29
30 .S.bin:
31 $(CC) -c $(CFLAGS) $*.S -o $*.o
32 $(LD) -Ttext 0x0 -s --oformat binary $*.o -o $*.bin
33
34 clean:
35 $(RM) *.s *.o *.bin *.srec *.com version.h