|
1 # Copyright (c) 2009 Symbian Foundation Ltd |
|
2 # This component and the accompanying materials are made available |
|
3 # under the terms of the License "Eclipse Public License v1.0" |
|
4 # which accompanies this distribution, and is available |
|
5 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
6 # |
|
7 # Initial Contributors: |
|
8 # Symbian Foundation Ltd - initial contribution. |
|
9 # Mike Kinghan, mikek@symbian.org |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # This is a Linux makefile for the imgutils library. |
|
15 |
|
16 ifdef EPOCROOT |
|
17 include $(EPOCROOT)/build/makefiles-garage/global-make-env.mk |
|
18 else |
|
19 $(error EPOCROOT must be defined as the parent directory of your epoc32 tree) |
|
20 endif |
|
21 |
|
22 fixfiles = inc/typedefs.h |
|
23 fixbackups = $(addsuffix .original,$(fixfiles)) |
|
24 |
|
25 cpp_inc_paths = \ |
|
26 -I ../inc \ |
|
27 -I ../libimgutils/inc \ |
|
28 -I ../../imglib/inc \ |
|
29 -I ../../romtools/rofsbuild \ |
|
30 -I ../../imglib/compress \ |
|
31 -I ../../imglib/e32image \ |
|
32 -I ../../imglib/e32image/deflate \ |
|
33 -I ../../imglib/inc \ |
|
34 -I ../../imglib/e32uid \ |
|
35 -I ../../romtools/rofsbuild \ |
|
36 -I ../../imglib/patchdataprocessor/include |
|
37 |
|
38 lib = libimgutils.a |
|
39 |
|
40 CPPFLAGS = $(cpp_inc_paths) $(global_cpp_flags) |
|
41 CXXFLAGS = $(global_cxx_flags) -pthread |
|
42 |
|
43 srcs = \ |
|
44 ../../imglib/compress/byte_pair.cpp \ |
|
45 ../../imglib/compress/pagedcompress.cpp \ |
|
46 ../../imglib/e32image/e32image.cpp \ |
|
47 ../../imglib/e32image/deflate/inflate.cpp \ |
|
48 ../../imglib/e32image/deflate/compress.cpp \ |
|
49 ../../imglib/e32image/deflate/decode.cpp \ |
|
50 ../../imglib/e32image/deflate/deflate.cpp \ |
|
51 ../../imglib/e32image/deflate/panic.cpp \ |
|
52 ../../imglib/e32image/deflate/encode.cpp \ |
|
53 ../../imglib/host/h_file.cpp \ |
|
54 ../../imglib/host/h_mem.cpp \ |
|
55 ../../imglib/host/h_utl.cpp \ |
|
56 ../../imglib/e32uid/e32uid.cpp \ |
|
57 ../../romtools/rofsbuild/r_coreimage.cpp \ |
|
58 ../../romtools/rofsbuild/r_build.cpp \ |
|
59 src/romreader.cpp \ |
|
60 src/imagereader.cpp \ |
|
61 src/e32reader.cpp \ |
|
62 src/rofsreader.cpp \ |
|
63 src/romimageheader.cpp \ |
|
64 src/rofsimage.cpp \ |
|
65 src/utils.cpp \ |
|
66 src/dirreader.cpp |
|
67 |
|
68 all: $(lib) |
|
69 |
|
70 .PHONY: all clean fixes remove_fixes |
|
71 |
|
72 bases = $(basename $(srcs)) |
|
73 |
|
74 objs = $(addsuffix .o,$(bases)) |
|
75 |
|
76 $(srcs): fixes |
|
77 |
|
78 $(lib): $(objs) |
|
79 ar r $@ $(objs) |
|
80 |
|
81 clean: remove_fixes |
|
82 rm -f $(objs) $(lib) |
|
83 |
|
84 fixes: $(fixbackups) |
|
85 |
|
86 inc/typedefs.h.original: |
|
87 cp $(basename $@) $@ && \ |
|
88 sed -e 's|fstream.h|fstream|g' -e 's|iostream.h|iostream|g' \ |
|
89 -e 's|typedef ios|typedef std::ios|g' \ |
|
90 -e 's|typedef ofstream|typedef std::ofstream|g' \ |
|
91 -e 's|typedef ifstream|typedef std::ifstream|g' -i $(basename $@) |
|
92 |
|
93 remove_fixes: |
|
94 for file in $(fixbackups); do if [ -f $$file ]; then mv -f $$file $${file%original}; fi; done |
|
95 |