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

Subversion Repositories core_arm

[/] [core_arm/] [trunk/] [build/] [Makefile.c] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 tarookumic
#Konrad Eisele<eiselekd@web.de>,2003
2
 
3
.PHONY: all
4
 
5
all: $(cmd)
6
 
7
include $(obj)/Makefile
8
include build/Makefile.conf
9
include build/Makefile.defs
10
 
11
# Select host/target compilation
12
# ---------------------------------------------------------------------------
13
ifeq ($($(target)_hostcompile),y)
14
     CURAS = $(AS)
15
     CURGCC = $(GCC)
16
     CURCPP = $(GCC) -E
17
     CURLD = $(LD)
18
     CURAR = $(AR)
19
     CURCFLAGS = $(c_flags)
20
     CURLDFLAGS = $(ld_flags)
21
else
22
     CURAS = $(CROSS)$(AS)
23
     CURGCC = $(CROSS)$(GCC)
24
     CURCPP = $(CROSS)$(GCC) -E
25
     CURLD = $(CROSS)$(LD)
26
     CURAR = $(CROSS)$(AR)
27
     CURCFLAGS = $(c_flags)
28
     CURLDFLAGS = $(ld_flags)
29
endif
30
 
31
# Single targets
32
# ---------------------------------------------------------------------------
33
 
34
 
35
  cmd_as_s_S = $(CURCPP) $(a_flags)   -o $@ $<
36
q_cmd_as_s_S = CPP $@
37
%.s: %.S FORCE
38
        $(call if_changed_dep,as_s_S)
39
 
40
  cmd_as_o_S = $(CURGCC) $(a_flags) -c -o $@ $<
41
q_cmd_as_o_S = AS $@
42
%.o: %.S
43
        $(call if_changed_dep,as_o_S)
44
 
45
  cmd_as_o_s = $(CURGCC) $(a_flags) -c -o $@ $<
46
q_cmd_as_o_s = AS $@
47
%.o: %.s
48
        $(call if_changed_dep,as_o_s)
49
 
50
  cmd_c_to_o = $(CURGCC) $(CURCFLAGS) -c -o $@ $<
51
q_cmd_c_to_o = GCC $@
52
%.o: %.c FORCE
53
        $(call if_changed_dep,c_to_o)
54
 
55
%.tab.c: %.y
56
        bison -t -d -v -b $* -p $(notdir $*)_ $<
57
 
58
# adjust to sub-directory 
59
# ---------------------------------------------------------------------------
60
$(target)_files         := $(addprefix $(obj)/,$($(target)_files))
61
$(target)_target        := $(addprefix $(obj)/,$($(target)_target))
62
$(target)_subdirs       := $(addprefix $(obj)/,$($(target)_subdirs))
63
 
64
# cmds to use 
65
# ---------------------------------------------------------------------------
66
cmd_ld = $(CURLD) -o $@ $(filter-out FORCE,$^) $(CURLDFLAGS) $(EXTRA_LDFLAGS)
67
cmd_ar = $(CURAR) -r -o $@  $(filter-out FORCE,$^)
68
#$(CURAR) r $@  $(filter-out FORCE,$^) 
69
#
70
 
71
ifeq ($(strip $(suffix $($(target)_target))),.a)
72
        docmd = ar
73
else
74
        docmd = ld
75
endif
76
 
77
dobuild: $(addsuffix /build.a,$($(target)_subdirs)) $($(target)_predeps) $($(target)_target) $($(target)_postdeps)
78
 
79
$($(target)_target): $($(target)_files)  FORCE
80
        $(call if_changed,$(docmd))
81
 
82
$(addsuffix /build.a,$($(target)_subdirs)): FORCE
83
        for i in $($(target)_subdirs); do \
84
                $(MAKE)  -f build/Makefile.switch obj=$$i cmd=dobuild || exit 1; \
85
        done
86
 
87
FORCE:
88
 
89
# Read all saved command lines and dependencies for the $(alltargets) we
90
# may be building above, using $(if_changed{,_dep}). As an
91
# optimization, we don't need to read them if the target does not
92
# exist, we will rebuild anyway in that case.
93
# ---------------------------------------------------------------------------
94
alltargets              := $($(target)_files) $($(target)_target)
95
alltargets              := $(wildcard $(sort $(alltargets)))
96
cmd_files               := $(wildcard $(foreach f,$(alltargets),$(dir $(f)).$(notdir $(f)).cmd))
97
ifneq ($(cmd_files),)
98
  include $(cmd_files)
99
endif
100
 
101
-include $(obj)/Makefile.post
102
 
103
 
104
 
105
 
106
 

powered by: WebSVN 2.1.0

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