Root/cntr/fw/common/Makefile

Source at commit 5109e0bd44a870009975cc1f3cdf6edcce8da5cb created 13 years 7 months ago.
By Werner Almesberger, Basic framework for CNTR firmware.
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
54

Archive Download this file



interactive