1 CFLAGS = -g -O2 -Wall $(CPPFLAGS)
3 TARGET = $(TOPDIR)/include/asm-ia64/offsets.h
11 rm -f print_offsets.s print_offsets offsets.h
14 @if ! cmp -s offsets.h ${TARGET}; then \
15 echo -e "*** Updating ${TARGET}..."; \
16 cp offsets.h ${TARGET}; \
18 echo "*** ${TARGET} is up to date"; \
22 # If we're cross-compiling, we use the cross-compiler to translate
23 # print_offsets.c into an assembly file and then awk to translate this
24 # file into offsets.h. This avoids having to use a simulator to
25 # generate this file. This is based on an idea suggested by Asit
26 # Mallick. If we're running natively, we can of course just build
27 # print_offsets and run it. --davidm
30 ifeq ($(CROSS_COMPILE),)
32 offsets.h: print_offsets
33 ./print_offsets > offsets.h
37 print_offsets: emptyoffsets print_offsets.c FORCE_RECOMPILE
38 $(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) print_offsets.c -o $@
44 offsets.h: print_offsets.s
45 $(AWK) -f print_offsets.awk $^ > $@
47 print_offsets.s: emptyoffsets print_offsets.c
48 $(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -S print_offsets.c -o $@
53 # The TARGET offsets.h is included by ptrace.h, which is included by
54 # print_offsets.c, so can't compile print_offsets.c to create offsets.h
55 # until we already have offsets.h. Break the chicken-and-egg cycle by
56 # creating a dummy offsets.h with sufficient define's to bootstrap
57 # the first compilation of print_offsets.c.
61 test -f ${TARGET} || echo '#define IA64_TASK_THREAD_OFFSET 0' > ${TARGET}
63 .PHONY: all modules modules_install