Makefile.rtems: Add a few missing files
[yaffs2.git] / rtems / Makefile.rtems
1 #
2 # This file was originally written to work from the yaffs2 base directory
3 # which required deleting some of the Linux files.
4 #
5 # This is now modified to run from the yaffs2/rtems directory and copies in
6 # all files as symbolic links.
7 #
8
9 include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
10 include $(RTEMS_MAKEFILE_PATH)/make/target.cfg
11
12 INSTALL_BASE = $(RTEMS_MAKEFILE_PATH)/lib
13
14 BUILDDIR = build-$(RTEMS_BSP)
15
16 CPPFLAGS += -I. 
17
18 DEPFLAGS = -MT $@ -MD -MP -MF $(basename $@).d
19
20 GCCFLAGS = -g -I . -B $(INSTALL_BASE) -specs bsp_specs -qrtems
21
22 CFLAGS += $(DEPFLAGS) $(GCCFLAGS)
23
24 # Files to be made into local symlinks
25 YCORE_SYMLINKS = \
26         yaffs_ecc.c \
27         yaffs_endian.c \
28         yaffs_guts.c \
29         yaffs_packedtags1.c \
30         yaffs_tagscompat.c \
31         yaffs_packedtags2.c \
32         yaffs_nand.c \
33         yaffs_checkptrw.c \
34         yaffs_nameval.c \
35         yaffs_allocator.c \
36         yaffs_bitmap.c \
37         yaffs_yaffs1.c \
38         yaffs_yaffs2.c \
39         yaffs_verify.c \
40         yaffs_summary.c \
41         yaffs_tagsmarshall.c\
42         yaffs_ecc.h \
43         yaffs_guts.h \
44         yaffs_packedtags1.h \
45         yaffs_tagscompat.h \
46         yaffs_packedtags2.h \
47         yaffs_nand.h \
48         yaffs_checkptrw.h \
49         yaffs_nameval.h \
50         yaffs_attribs.h \
51         yaffs_allocator.h \
52         yaffs_bitmap.h \
53         yaffs_yaffs1.h \
54         yaffs_yaffs2.h \
55         yaffs_verify.h \
56         yaffs_summary.h \
57         yaffs_trace.h \
58         yaffs_endian.h \
59         yaffs_getblockinfo.h \
60         yaffs_tagsmarshall.h
61
62
63 DIRECT_SYMLINKS = \
64         yaffs_attribs.c \
65         yaffs_hweight.c \
66         yaffs_hweight.h \
67         yportenv.h \
68         ydirectenv.h \
69         yaffscfg.h \
70         yaffs_osglue.h \
71         yaffs_list.h \
72         yaffsfs.h
73
74 DIRECT_QSORT_SYMLINKS = \
75         qsort.c
76
77 ALL_SYMLINKS = $(YCORE_SYMLINKS) $(DIRECT_SYMLINKS) $(DIRECT_QSORT_SYMLINKS)
78
79
80 INCLUDES = rtems_yaffs.h \
81         yportenv.h \
82         ydirectenv.h \
83         yaffs_osglue.h \
84         yaffs_hweight.h \
85         yaffscfg.h \
86         yaffs_list.h \
87         yaffsfs.h \
88         yaffs_guts.h \
89         yaffs_packedtags2.h \
90         yaffs_ecc.h
91
92 LIB = $(BUILDDIR)/libyaffs2.a
93 LIB_PIECES = yaffs_ecc \
94         yaffs_endian \
95         yaffs_guts \
96         yaffs_packedtags1 \
97         yaffs_tagscompat \
98         yaffs_tagsmarshall\
99         yaffs_packedtags2 \
100         yaffs_nand \
101         yaffs_checkptrw \
102         qsort \
103         yaffs_nameval \
104         yaffs_attribs \
105         yaffs_allocator \
106         yaffs_bitmap \
107         yaffs_yaffs1 \
108         yaffs_yaffs2 \
109         yaffs_verify \
110         yaffs_summary \
111         yaffs_hweight \
112         rtems_yaffs \
113         rtems_yaffs_os_context \
114         rtems_yaffs_os_glue
115 LIB_OBJS = $(LIB_PIECES:%=$(BUILDDIR)/%.o)
116 LIB_DEPS = $(LIB_PIECES:%=$(BUILDDIR)/%.d)
117
118 all: $(BUILDDIR) $(ALL_SYMLINKS) $(LIB)
119
120 symlinks:$(ALL_SYMLINKS)
121
122 $(YCORE_SYMLINKS): 
123         ln -s ../$@ $@
124
125 $(DIRECT_SYMLINKS): 
126         ln -s ../direct/$@ $@
127
128 $(DIRECT_QSORT_SYMLINKS): 
129         ln -s ../direct/optional_sort/$@ $@
130
131 $(BUILDDIR):
132         mkdir $(BUILDDIR)
133
134 $(LIB): $(LIB_OBJS)
135         $(AR) rcu $@ $^
136         $(RANLIB) $@
137
138 $(BUILDDIR)/%.o: %.c
139         $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
140
141 clean:
142         rm -rf $(BUILDDIR) $(ALL_SYMLINKS)
143
144 install:  all
145         mkdir -p $(INSTALL_BASE)/include/yaffs
146         install -m 644 $(LIB) $(INSTALL_BASE)
147         install -m 644 $(INCLUDES) $(INSTALL_BASE)/include/yaffs
148
149 .PHONY: clean install
150
151 -include $(LIB_DEPS)