Date:2010-08-20 03:02:38 (10 years 2 months ago)
Author:Werner Almesberger
Commit:f8cd15e84dcd647ff316c67924e055bf38b1fc74
Message:Generate port, bit, and output mode definitions from io.h

- fw/common/Makefile: generate related definitions from io.h (from IBDG)
- fw/Makefile: build the various firmware elements (from IDBG, without the
target parts)
Files: fw/Makefile (1 diff)
fw/common/Makefile (1 diff)

Change Details

fw/Makefile
1#
2# fw/Makefile - ATSPI firmware build
3#
4# Written 2008-2010 by Werner Almesberger
5# Copyright 2008-2010 Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13
14DIRS=common boot atspi
15
16
17.PHONY: all depend install uninstall clean spotless
18
19all:
20        for d in $(DIRS); do make -C $$d all || exit 1; done
21
22depend:
23        for d in $(DIRS); do make -C $$d depend || exit 1; done
24
25# Top-level Makefile recurses for "install" and "uninstall", which have no use
26# here. Just ignore them.
27
28install:
29
30uninstall:
31
32clean:
33        for d in $(DIRS); do make -C $$d clean || exit 1; done
34
35spotless:
36        for d in $(DIRS); do make -C $$d spotless || exit 1; done
fw/common/Makefile
1#
2# common/Makefile - Makefile for shared items
3#
4# Written 2008, 2010 by Werner Almesberger
5# Copyright 2008, 2010 Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13
14GEN_quiet = @echo " GENERATE " $@ &&
15
16ifeq ($(V),1)
17    GEN =
18else
19    GEN = $(GEN_quiet)
20endif
21
22
23.PHONY: all depend clean spotless
24
25all: io-parts.h
26
27io-parts.h: io.h Makefile
28        $(GEN) $(CPP) -dD $< | \
29          sed '1,/IO_H/d' | \
30          awk \
31          'BEGIN { print "/* MACHINE-GENERATED. DO NOT EDIT ! */"; \
32            print "#ifndef IO_PARTS_H"; \
33            print "#define IO_PARTS_H"; } \
34           /#define/ && $$3 != "" { \
35            split($$3, a, "_"); \
36            print $$1, $$2 "_PORT", a[1]; \
37            print $$1, $$2 "_MODE", a[1] "MDOUT"; \
38            print $$1, $$2 "_BIT", a[2]; } \
39           END { print "#endif" }' >$@ || \
40                { rm -f $@; exit 1; }
41
42
43#
44# When we do a global "make depend", we'll come here first. So we create
45# io-parts.h so that "make depend" in the other directories can pick it up.
46#
47
48depend: io-parts.h
49
50clean:
51        rm -f io-parts.h
52
53spotless: clean

Archive Download the corresponding diff file



interactive