OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [arch/] [ia64/] [tools/] [Makefile] - Blame information for rev 1781

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
CFLAGS  = -g -O2 -Wall $(CPPFLAGS)
2
 
3
TARGET  = $(TOPDIR)/include/asm-ia64/offsets.h
4
 
5
all:
6
 
7
mrproper: clean
8
        rm -f $(TARGET)
9
 
10
clean:
11
        rm -f print_offsets.s print_offsets offsets.h
12
 
13
fastdep: offsets.h
14
        @if ! cmp -s offsets.h ${TARGET}; then  \
15
                echo -e "*** Updating ${TARGET}...";    \
16
                cp offsets.h ${TARGET};         \
17
        else                                    \
18
                echo "*** ${TARGET} is up to date";     \
19
        fi
20
 
21
#
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
28
#
29
 
30
ifeq ($(CROSS_COMPILE),)
31
 
32
offsets.h: print_offsets
33
        ./print_offsets > offsets.h
34
 
35
comma   := ,
36
 
37
print_offsets: emptyoffsets print_offsets.c FORCE_RECOMPILE
38
        $(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) print_offsets.c -o $@
39
 
40
FORCE_RECOMPILE:
41
 
42
else
43
 
44
offsets.h: print_offsets.s
45
        $(AWK) -f print_offsets.awk $^ > $@
46
 
47
print_offsets.s: emptyoffsets print_offsets.c
48
        $(CC) $(CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) -S print_offsets.c -o $@
49
 
50
endif
51
 
52
#
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.
58
#
59
 
60
emptyoffsets:
61
        test -f ${TARGET} || echo '#define IA64_TASK_THREAD_OFFSET 0' > ${TARGET}
62
 
63
.PHONY: all modules modules_install

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.