|
1 | 1 | # |
2 | | -# OpenBIOS - free your system! |
3 | | -# ( detokenizer ) |
4 | | -# |
5 | | -# This program is part of a free implementation of the IEEE 1275-1994 |
| 2 | +# OpenBIOS - free your system! |
| 3 | +# ( Utilities ) |
| 4 | +# |
| 5 | +# This program is part of a free implementation of the IEEE 1275-1994 |
6 | 6 | # Standard for Boot (Initialization Configuration) Firmware. |
7 | 7 | # |
8 | | -# Copyright (C) 2001-2005 Stefan Reinauer, <stepan@openbios.org> |
| 8 | +# Copyright (C) 2001-2006 Stefan Reinauer <stepan@openbios.org> |
| 9 | +# Copyright (C) 2006 coresystems GmbH <info@coresystems.de> |
9 | 10 | # |
10 | 11 | # This program is free software; you can redistribute it and/or modify |
11 | 12 | # it under the terms of the GNU General Public License as published by |
|
21 | 22 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA |
22 | 23 | # |
23 | 24 |
|
24 | | -ARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ -e "s/Power Macintosh/ppc/") |
25 | | -TOPDIR := $(shell /bin/pwd) |
26 | | -BUILDDIR ?= $(TOPDIR)/obj-$(ARCH) |
| 25 | +PROGRAM = detok |
27 | 26 |
|
28 | | -VPATH := $(BUILDDIR) |
| 27 | +CC = gcc |
| 28 | +STRIP = strip |
| 29 | +INCLUDES = -I../shared |
| 30 | +#CFLAGS = -O2 -g -Wall |
| 31 | +CFLAGS = -Os -Wall -Wno-pointer-sign |
| 32 | +LDFLAGS = |
29 | 33 |
|
| 34 | +OBJS = addfcodes.o decode.o detok.o dictionary.o pcihdr.o printformats.o \ |
| 35 | + stream.o ../shared/classcodes.o |
30 | 36 |
|
31 | | -include $(TOPDIR)/Rules.make |
| 37 | +all: .dependencies $(PROGRAM) |
32 | 38 |
|
| 39 | +$(PROGRAM): $(OBJS) |
| 40 | + $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) |
| 41 | + $(STRIP) -s $(PROGRAM) |
33 | 42 |
|
34 | | -CC = gcc |
35 | | -CFLAGS = -O2 -Wall -ansi |
| 43 | +clean: |
| 44 | + rm -f $(OBJS) *~ |
36 | 45 |
|
37 | | -# For debugging the indentation code of detok, define DEBUG_INDENT |
38 | | -#CFLAGS := $(CFLAGS) -DDEBUG_INDENT |
| 46 | +distclean: clean |
| 47 | + rm -f $(PROGRAM) .dependencies |
| 48 | + |
| 49 | +.dependencies: *.c |
| 50 | + @$(CC) $(CFLAGS) $(INCLUDES) -MM *.c > .dependencies |
39 | 51 |
|
40 | | -all: main detok |
41 | | - @echo -e "\nOpenBIOS detokenizer detok build finished\n" |
| 52 | +.PHONY: all clean distclean |
42 | 53 |
|
43 | | -main: |
44 | | - @echo -e "\nWelcome to the OpenBIOS detokenizer.." |
45 | | - @test -r $(BUILDDIR) || ( mkdir -p $(BUILDDIR); \ |
46 | | - echo -e "\nCreating build directory $(BUILDDIR)" ) |
47 | | - |
48 | | -detok: detok.o dictionary.o decode.o stream.o |
49 | | - @echo -en "\nLinking fcode detokenizer detok..." |
50 | | - @cd $(BUILDDIR) && ( $(CC) $(CFLAGS) $^ -o $@; strip detok ) |
51 | | - @echo -e "\tok" |
52 | | - |
53 | | -clean: |
54 | | - @test ! -d $(BUILDDIR) && \ |
55 | | - echo "Architecture $(ARCH) is already clean." || \ |
56 | | - ( \ |
57 | | - echo "Cleaning up architecture $(ARCH)"; \ |
58 | | - rm -rf $(BUILDDIR) \ |
59 | | - rm forth.dict.core \ |
60 | | - ) |
| 54 | +-include .dependencies |
61 | 55 |
|
62 | | -distclean: clean |
63 | | - rm -f detok |
| 56 | +.c.o: |
| 57 | + $(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@ |
64 | 58 |
|
65 | | -detok.o: detok.h stream.h detok.c |
66 | | -stream.o: detok.h stream.c |
67 | | -decode.o: detok.h stream.h decode.c Makefile |
68 | | -dictionary.o: detok.h dictionary.c |
0 commit comments