source: rtems/c/src/lib/libbsp/arm/nds/dswifi/arm7/makefile @ fa97db5

4.104.115
Last change on this file since fa97db5 was fa97db5, checked in by Sebastian Huber <sebastian.huber@…>, on 04/30/10 at 13:41:52

2010-04-30 Sebastian Huber <sebastian.huber@…>

  • make/custom/nds.cfg, Makefile.am, dswifi/arm7/makefile: Use VFP floating point model.
  • Property mode set to 100644
File size: 5.1 KB
Line 
1#---------------------------------------------------------------------------------
2.SUFFIXES:
3#---------------------------------------------------------------------------------
4ifeq ($(strip $(DEVKITARM)),)
5$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM)
6endif
7
8include $(DEVKITARM)/ds_rules
9
10TOPDIR ?= $(CURDIR)/..
11
12#---------------------------------------------------------------------------------
13# BUILD is the directory where object files & intermediate files will be placed
14# SOURCES is a list of directories containing source code
15# INCLUDES is a list of directories containing extra header files
16# DATA is a list of directories containing binary files
17# all directories are relative to this makefile
18#---------------------------------------------------------------------------------
19BUILD           ?=      release
20SOURCES         :=      source ../common/source
21INCLUDES        :=      include build ../common/source ../include
22DATA            :=
23 
24#---------------------------------------------------------------------------------
25# options for code generation
26#---------------------------------------------------------------------------------
27ARCH    :=      -mthumb-interwork
28
29CFLAGS  :=      -g -Wall -O2\
30                        -mcpu=arm7tdmi -mtune=arm7tdmi -mfpu=vfp -mfloat-abi=soft -fomit-frame-pointer\
31                        -ffast-math \
32                        $(ARCH)
33
34CFLAGS  +=      $(INCLUDE) -DARM7
35CXXFLAGS        :=      $(CFLAGS)
36
37
38ASFLAGS :=      -g $(ARCH)
39LDFLAGS =       -specs=ds_arm7.specs -g $(ARCH) -mno-fpu -Wl,-Map,$(notdir $*).map
40
41
42ifneq ($(BUILD),debug)
43export ARM7BIN  :=      $(TOPDIR)/lib/libdswifi7.a
44else
45export ARM7BIN  :=      $(TOPDIR)/lib/libdswifi7d.a
46CFLAGS  +=      -DSGIP_DEBUG
47endif
48
49
50LIBS    :=
51#-lnds7
52
53#---------------------------------------------------------------------------------
54# list of directories containing libraries, this must be the top level containing
55# include and lib
56#---------------------------------------------------------------------------------
57LIBDIRS :=      $(LIBNDS)
58 
59 
60#---------------------------------------------------------------------------------
61# no real need to edit anything past this point unless you need to add additional
62# rules for different file extensions
63#---------------------------------------------------------------------------------
64ifneq ($(BUILD),$(notdir $(CURDIR)))
65#---------------------------------------------------------------------------------
66 
67export DEPSDIR  :=      $(CURDIR)/$(BUILD)
68
69export VPATH    :=      $(foreach dir,$(SOURCES),$(CURDIR)/$(dir))
70 
71export CC               :=      $(PREFIX)gcc
72export CXX              :=      $(PREFIX)g++
73export AR               :=      $(PREFIX)ar
74export OBJCOPY  :=      $(PREFIX)objcopy
75 
76CFILES          :=      $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
77CPPFILES        :=      $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
78SFILES          :=      $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
79BINFILES        :=      $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
80 
81export OFILES   :=      $(addsuffix .o,$(BINFILES)) \
82                                        $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
83 
84export INCLUDE  :=      $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
85                                        $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
86                                        -I$(CURDIR)/$(BUILD)
87 
88export LIBPATHS :=      $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
89
90#---------------------------------------------------------------------------------
91# use CXX for linking C++ projects, CC for standard C
92#---------------------------------------------------------------------------------
93ifeq ($(strip $(CPPFILES)),)
94#---------------------------------------------------------------------------------
95        export LD       :=      $(CC)
96#---------------------------------------------------------------------------------
97else
98#---------------------------------------------------------------------------------
99        export LD       :=      $(CXX)
100#---------------------------------------------------------------------------------
101endif
102#---------------------------------------------------------------------------------
103
104.PHONY: $(BUILD) clean
105 
106#---------------------------------------------------------------------------------
107$(BUILD):
108        @[ -d $@ ] || mkdir -p $@
109        @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/makefile
110 
111#---------------------------------------------------------------------------------
112clean:
113        @echo clean ...
114        @rm -fr debug release
115        @rm -f $(TOPDIR)/lib/libdswifi7*
116 
117all: $(ARM7BIN)
118 
119#---------------------------------------------------------------------------------
120else
121 
122DEPENDS :=      $(OFILES:.o=.d)
123 
124#---------------------------------------------------------------------------------
125# main targets
126#---------------------------------------------------------------------------------
127$(ARM7BIN)      :       $(OFILES)
128        @rm -f "$(ARM7BIN)"
129        @$(AR) rcs "$(ARM7BIN)" $(OFILES)
130        @echo built ... $(notdir $@)
131
132
133#---------------------------------------------------------------------------------
134# you need a rule like this for each extension you use as binary data
135#---------------------------------------------------------------------------------
136%.bin.o :       %.bin
137#---------------------------------------------------------------------------------
138        @echo $(notdir $<)
139        @$(bin2o)
140
141-include $(DEPENDS)
142 
143#---------------------------------------------------------------------------------------
144endif
145#---------------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.