summaryrefslogtreecommitdiff
path: root/firmware/test/memory/makefile
diff options
context:
space:
mode:
authorAlan Korr <alkorr@rockbox.org>2002-04-15 23:19:10 +0000
committerAlan Korr <alkorr@rockbox.org>2002-04-15 23:19:10 +0000
commit27df7b0b96686771b9fafba33d0a97b4d77f6206 (patch)
tree638189ff3754910b98f4725167fe621c4c20436a /firmware/test/memory/makefile
parentf5747cf78a4506dca544fde5324fd020a988c73b (diff)
downloadrockbox-27df7b0b96686771b9fafba33d0a97b4d77f6206.tar.gz
rockbox-27df7b0b96686771b9fafba33d0a97b4d77f6206.zip
*** empty log message ***
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@98 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/memory/makefile')
-rw-r--r--firmware/test/memory/makefile193
1 files changed, 193 insertions, 0 deletions
diff --git a/firmware/test/memory/makefile b/firmware/test/memory/makefile
new file mode 100644
index 0000000000..2259cdfce7
--- /dev/null
+++ b/firmware/test/memory/makefile
@@ -0,0 +1,193 @@
1#############################################################################
2## __________ __ ___.
3## Open \______ \ ____ ____ | | _\_ |__ _______ ___
4## Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5## Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6## Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7## \/ \/ \/ \/ \/
8## Copyright Alan Korr, 2002. All rights reserved.
9##
10## Permission to use, copy, modify, and distribute this software for any
11## purpose is hereby granted without fee, provided that this copyright and
12## permissions notice appear in all copies and derivatives, and that no
13## charge may be made for the software and its documentation except to cover
14## cost of distribution.
15##
16## This software is provided "as is" without express or implied warranty.
17#############################################################################
18ARCH = test
19
20CC = gcc
21AS = as
22LD = ld
23AR = ar
24RL = ranlib
25OC = objcopy
26GZ = gzip -f
27
28PREFIX = ~/rockbox/$(ARCH)
29PACKAGE = memory
30VERSION = 0.1
31DEFINES = -DTEST
32
33#####################################################"
34# Compiler flags :
35
36CFLAGS = -g
37#CFLAGS += -save-temps
38CFLAGS += -Wall \
39 -W \
40 -Wshadow \
41 -Wpointer-arith \
42 -Waggregate-return \
43 -Wstrict-prototypes \
44 -Wredundant-decls \
45 -Winline \
46 -Wmissing-prototypes \
47 -Werror \
48 -Wsign-compare \
49 -Wmissing-declarations \
50 -Wmissing-noreturns \
51 -Wnested-externs
52CFLAGS += -pipe -O3
53CFLAGS += -fomit-frame-pointer \
54 -fschedule-insns
55CFLAGS += $(EXTRA_CFLAGS)
56CFLAGS += $(DEFINES)
57
58#######################################################################
59## PLEASE CONSIDER THERE IS NOTHING TO CHANGE IN THE FOLLOWING LINES
60## SINCE THERE ARE COMMON FOR ALL LIBRARY
61##
62
63.SUFFIXES : .o .c .s
64
65INCLUDES = -I. \
66 -I$(PREFIX)/headers
67
68STATIC_LIBRARY_PATH = $(PREFIX)/libraries
69
70LIBRARY = lib$(PACKAGE).a
71
72#######################################################################
73## PLEASE CHANGE ONLY THE FOLLOWING LINES
74##
75
76LIBS =
77
78HEADERS = $(PACKAGE).h \
79 config.h \
80 defines.h \
81 types.h \
82 return_values.h \
83 inlines.h \
84 functions.h
85
86SOURCES = $(PACKAGE)-page.c \
87 $(PACKAGE)-slab.c
88
89OBJECTS = $(SOURCES:.c=.o)
90
91DEPENDENCIES = $(SOURCES:.c=.d)
92
93HEADER_PATH = $(PREFIX)/headers/$(PACKAGE)/.
94
95#######################################################################
96## PLEASE CONSIDER THERE IS NOTHING TO CHANGE IN THE FOLLOWING LINES
97## SINCE THERE ARE COMMON FOR ALL LIBRARY
98##
99
100%.o: %.c
101 @echo "Compiling" $<...
102 @$(CC) -o $(@) $(CFLAGS) $(INCLUDES) -c $<
103 @$(CC) -M $< $(CFLAGS) $(INCLUDES) > $(*F).d
104
105%.o: %.s
106 @echo "Assembling" $<...
107 @$(CC) -o $(@) $(CFLAGS) $(INCLUDES) -c $<
108 @$(CC) -M $< $(CFLAGS) $(INCLUDES) > $(*F).d
109
110.PHONY: splash all clean backup restore dist install
111
112all: splash $(LIBRARY) test
113
114splash:
115 @echo "<<< " $(PACKAGE) "-" $(VERSION) ">>>"
116
117####################################################
118# LIBRAY PART :
119
120$(LIBRARY): $(OBJECTS)
121 @echo "Creating library" $(LIBRARY)...
122 @$(AR) cru $(@) $(OBJECTS)
123 @$(RL) $(@)
124
125
126####################################################
127# TEST PART :
128
129test: test.tab.o test.lex.o $(LIBRARY)
130 @echo "Creating executable" $@...
131 @$(CC) $(INCLUDES) -g -o $(@) $(+) -lfl -lreadline
132
133test.tab.o: test.tab.c
134 @echo "Compiling" $<...
135 @$(CC) -I. -g -o $(@) -O3 -fomit-frame-pointer -c test.tab.c
136
137test.lex.o: test.lex.c
138 @echo "Compiling" $<...
139 @$(CC) -I. -g -o $(@) -O3 -fomit-frame-pointer -c test.lex.c
140
141test.tab.h: test.tab.c
142
143test.lex.c: test.l test.tab.h
144 @echo "Flex:" $<
145 @flex -otest.lex.c test.l
146
147test.tab.c: test.y
148 @echo "Bison:" $<
149 @bison -d test.y
150
151
152####################################################
153# MISCELLANOUS PART :
154
155clean:
156 @rm -f $(LIBRARY)
157 @rm -f $(OBJECTS) test.lex.o test.tab.o
158 @rm -f $(DEPENDENCIES)
159 @rm -f *~ test test.exe
160 @rm -f test.tab.h test.tab.c test.lex.c
161 @rm -f core
162
163backup:
164 @mkdir -p ./backup
165 @cp -f makefile ./backup
166 @cp -f test.l ./backup
167 @cp -f test.y ./backup
168 @cp -f $(SOURCES:.c=.txt) ./backup
169 @for header in $(HEADERS) ; do cp -f $$header ./backup ; done
170 @for source in $(SOURCES) ; do cp -f $$source ./backup ; done
171
172restore:
173 @cp -f ./backup/makefile .
174 @cp -f ./backup/test.l .
175 @cp -f ./backup/test.y .
176 @cp -f ./backup/$(SOURCES:.c=.txt)
177 @for header in $(HEADERS) ; do cp -f ./backup/$$header . ; done
178 @for source in $(SOURCES) ; do cp -f ./backup/$$source . ; done
179
180dist: backup
181 @mv backup $(PACKAGE)
182 @tar czvf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)/*
183 @rm -f $(PACKAGE)/*
184 @rmdir $(PACKAGE)
185
186install: all
187 @mkdir -p $(PREFIX)/libraries
188 @cp $(LIBRARY) $(PREFIX)/libraries
189 @mkdir -p $(PREFIX)/headers/$(PACKAGE)
190 @for header in $(HEADERS) ; do cp $$header $(PREFIX)/headers/$(PACKAGE) ; done
191
192-include $(DEPENDENCIES)
193