Root/atusb-sil/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
13include Makefile.common
14
15
16GEN_quiet = @echo " GENERATE " $@ &&
17
18ifeq ($(V),1)
19    GEN =
20else
21    GEN = $(GEN_quiet)
22endif
23
24
25.PHONY: all depend clean spotless
26
27all: io-parts.h
28
29io-parts.h: io.h Makefile
30        $(GEN) $(CPP) -D$(BOARD) -dD $< | \
31          sed '1,/IO_H/d' | \
32          awk \
33          'BEGIN { print "/* MACHINE-GENERATED. DO NOT EDIT ! */"; \
34            print "#ifndef IO_PARTS_H"; \
35            print "#define IO_PARTS_H"; } \
36           /#define/ && $$3 != "" { \
37            split($$3, a, "_"); \
38            print $$1, $$2 "_PORT", a[1]; \
39            print $$1, $$2 "_MODE", a[1] "MDOUT"; \
40            print $$1, $$2 "_BIT", a[2]; } \
41           END { print "#endif" }' >$@ || \
42                { rm -f $@; exit 1; }
43
44
45#
46# When we do a global "make depend", we'll come here first. So we create
47# io-parts.h so that "make depend" in the other directories can pick it up.
48#
49
50depend: io-parts.h
51
52clean:
53        rm -f io-parts.h
54
55spotless: clean
56

Archive Download this file



interactive