2 # linux/arch/arm/tools/Makefile
4 # Copyright (C) 2001 Russell King
7 all: $(TOPDIR)/include/asm-arm/mach-types.h \
8 $(TOPDIR)/include/asm-arm/constants.h
10 $(TOPDIR)/include/asm-arm/mach-types.h: mach-types gen-mach-types
11 awk -f gen-mach-types mach-types > $@
13 # Generate the constants.h header file using the compiler. We get
14 # the compiler to spit out assembly code, and then mundge it into
15 # what we want. We do this in several stages so make picks up on
16 # any errors that occur along the way.
18 constants.h: constants-hdr getconstants.c
19 $(CC) $(CFLAGS) -S -o $@.tmp.1 getconstants.c
20 sed 's/^\(#define .* \)[#$$]\(.*\)/\1\2/;/^#define/!d' $@.tmp.1 > $@.tmp.2
21 cat constants-hdr $@.tmp.2 > $@
24 # Only update include/asm-arm/constants.h when it has actually changed.
26 $(TOPDIR)/include/asm-arm/constants.h: constants.h
27 cmp constants.h $@ >/dev/null 2>&1 || cp -p constants.h $@
29 # Build our dependencies, and then generate the constants and
30 # mach-types header files. If we do it now, mkdep will pick
31 # the dependencies up later on when it runs through the other
35 $(TOPDIR)/scripts/mkdep $(CFLAGS) $(EXTRA_CFLAGS) -- getconstants.c |\
36 sed s,getconstants.o,constants.h, > .depend
41 ifneq ($(wildcard .depend),)