|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # This component and the accompanying materials are made available |
|
5 # under the terms of the License "Eclipse Public License v1.0" |
|
6 # which accompanies this distribution, and is available |
|
7 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 # |
|
9 # Initial Contributors: |
|
10 # Nokia Corporation - initial contribution. |
|
11 # |
|
12 # Contributors: |
|
13 # |
|
14 # Description: |
|
15 # |
|
16 #------------------------------------------------------------------------ |
|
17 # Directory |
|
18 #------------------------------------------------------------------------ |
|
19 BASE_DIR = .\romtools\rombuild |
|
20 BUILD_DIR = $(BASE_DIR)\build\romtools\rombuild |
|
21 RELEASE_DIR = $(BASE_DIR)\build |
|
22 SOURCE_DIR = $(BASE_DIR) |
|
23 IMGLIB_DIR = ..\..\imglib |
|
24 E32UID_DIR = $(IMGLIB_DIR)\e32uid |
|
25 HOST_DIR = $(IMGLIB_DIR)\host |
|
26 E32IMGAE_DIR = $(IMGLIB_DIR)\e32image |
|
27 COMPRESS_DIR = $(IMGLIB_DIR)\compress |
|
28 #------------------------------------------------------------------------ |
|
29 # Target and Source File Specifiers |
|
30 #------------------------------------------------------------------------ |
|
31 TARGET = rombuild.exe |
|
32 SOURCE = r_areaset.cpp \ |
|
33 r_build.cpp \ |
|
34 r_collapse.cpp \ |
|
35 r_coreimage.cpp \ |
|
36 r_coreimagereader.cpp \ |
|
37 r_dir.cpp \ |
|
38 r_global.cpp \ |
|
39 r_header.cpp \ |
|
40 r_obey.cpp \ |
|
41 r_rom.cpp \ |
|
42 r_srec.cpp \ |
|
43 rombuild.cpp \ |
|
44 $(E32UID_DIR)\e32uid.cpp \ |
|
45 $(HOST_DIR)\h_file.cpp \ |
|
46 $(HOST_DIR)\h_mem.cpp \ |
|
47 $(HOST_DIR)\h_utl.cpp \ |
|
48 $(E32IMGAE_DIR)\e32image.cpp \ |
|
49 $(E32IMGAE_DIR)\deflate\decode.cpp \ |
|
50 $(E32IMGAE_DIR)\deflate\encode.cpp \ |
|
51 $(E32IMGAE_DIR)\deflate\deflate.cpp \ |
|
52 $(E32IMGAE_DIR)\deflate\inflate.cpp \ |
|
53 $(E32IMGAE_DIR)\deflate\panic.cpp \ |
|
54 $(E32IMGAE_DIR)\deflate\compress.cpp \ |
|
55 $(COMPRESS_DIR)\byte_pair.cpp \ |
|
56 $(COMPRESS_DIR)\pagedcompress.cpp |
|
57 |
|
58 #------------------------------------------------------------------------ |
|
59 # C++ Compiler Options |
|
60 #------------------------------------------------------------------------ |
|
61 CC = \epoc32\gcc_mingw\bin\g++ |
|
62 CC_DEFINES = __SYMBIAN32__ __TOOLS2__ __MINGW32__ _STLP_LITTLE_ENDIAN __EXE__ WIN32 _WINDOWS __TOOLS__ __TOOLS2_WINDOWS__ __SUPPORT_CPP_EXCEPTIONS__ __PRODUCT_INCLUDE__=\"${EPOCROOT}epoc32\include\variant\Symbian_OS.hrh\" |
|
63 CC_FLAGS = -g -fdefer-pop -fmerge-constants -fthread-jumps -floop-optimize -fif-conversion -fif-conversion2 -fguess-branch-probability -fcprop-registers -fforce-mem -foptimize-sibling-calls -fstrength-reduce -fcse-follow-jumps -fcse-skip-blocks -frerun-cse-after-loop -frerun-loop-opt -fgcse -fgcse-lm -fgcse-sm -fgcse-las -fdelete-null-pointer-checks -fexpensive-optimizations -fregmove -fschedule-insns -fschedule-insns2 -fsched-interblock -fsched-spec -fcaller-saves -fpeephole2 -freorder-blocks -freorder-functions -fstrict-aliasing -funit-at-a-time -falign-functions -falign-jumps -falign-loops -falign-labels -fcrossjumping -pipe -c -Wall -W -Wno-ctor-dtor-privacy -Wno-unknown-pragmas -mthreads -O2 -Wno-uninitialized |
|
64 USER_INCLUDE_DIR = $(BASE_DIR)\$(IMGLIB_DIR)\inc $(BASE_DIR)\$(COMPRESS_DIR) \ |
|
65 $(BASE_DIR)\$(IMGLIB_DIR)\patchdataprocessor\include \ |
|
66 $(BASE_DIR)\$(IMGLIB_DIR)\parameterfileprocessor\include \ |
|
67 $(BASE_DIR)\$(IMGLIB_DIR)\memmap\include \ |
|
68 "$(BASE_DIR)\$(IMGLIB_DIR)\boostlibrary" |
|
69 |
|
70 CC_INCLUDES = $(SOURCE_DIR) $(USER_INCLUDE_DIR) |
|
71 SYSTEM_INCLUDE_DIR = "${EPOCROOT}epoc32\include\tools\stlport" \ |
|
72 "${EPOCROOT}epoc32\include" \ |
|
73 "${EPOCROOT}epoc32\include\variant" \ |
|
74 "${EPOCROOT}epoc32\include\tools\stlport" |
|
75 CC_FLAGS_INCLUDES_SYSTEM = $(addprefix -isystem, $(SYSTEM_INCLUDE_DIR)) |
|
76 CC_FLAGS_INCLUDES_FILE = -include "${EPOCROOT}epoc32\include\gcc_mingw\gcc_mingw.h" |
|
77 CC_OPTIONS = $(addprefix -D, $(CC_DEFINES)) \ |
|
78 $(addprefix -I, $(CC_INCLUDES)) \ |
|
79 $(CC_FLAGS) \ |
|
80 $(CC_FLAGS_INCLUDES_SYSTEM) \ |
|
81 $(CC_FLAGS_INCLUDES_FILE) |
|
82 |
|
83 #------------------------------------------------------------------------ |
|
84 # Object Files, derived from source |
|
85 #------------------------------------------------------------------------ |
|
86 BUILD_TARGET = $(addprefix $(RELEASE_DIR)\,$(TARGET)) |
|
87 OBJECT_FILES = $(addprefix $(BUILD_DIR)\,$(SOURCE:.cpp=.o)) |
|
88 SOURCE_FILES = $(addprefix $(SOURCE_DIR)\,$(SOURCE)) |
|
89 |
|
90 #------------------------------------------------------------------------ |
|
91 # Principal and default target |
|
92 #------------------------------------------------------------------------ |
|
93 all: $(BUILD_DIR) $(BUILD_TARGET) |
|
94 |
|
95 #------------------------------------------------------------------------ |
|
96 # Link Stage |
|
97 # ---------- |
|
98 # Note we're linking to the static version of STL port, we also need to |
|
99 # include the pthread library. |
|
100 #------------------------------------------------------------------------ |
|
101 LINK_LIB_DIR = $(EPOCROOT)epoc32\release\tools2\deb |
|
102 LINK_OPTIONS = -L$(LINK_LIB_DIR) -L$(BASE_DIR) |
|
103 LINK_STATIC_LIB = patchdataprocessor parameterfileprocessor memmap |
|
104 LINK_SYSTEM_LIB = stlport.5.1 boost_thread-mgw34-mt-1_39_win32 |
|
105 LINK_LIB_OPTIONS = $(addprefix -l, $(LINK_STATIC_LIB)) $(addprefix -l, $(LINK_SYSTEM_LIB)) |
|
106 |
|
107 $(BUILD_TARGET) : $(OBJECT_FILES) |
|
108 $(CC) $(LINK_OPTIONS) -o$@ $^ -Wl,-Bstatic $(LINK_LIB_OPTIONS) |
|
109 |
|
110 #------------------------------------------------------------------------ |
|
111 # Object File Compilation |
|
112 #------------------------------------------------------------------------ |
|
113 #$(OBJECT_FILES): |
|
114 $(OBJECT_FILES): $(BUILD_DIR)\\%.o: $(SOURCE_DIR)\\%.cpp |
|
115 $(CC) $(CC_OPTIONS) $< -o $@ |
|
116 |
|
117 #------------------------------------------------------------------------ |
|
118 # CLEAN |
|
119 #------------------------------------------------------------------------ |
|
120 clean: |
|
121 del $(BUILD_DIR)\*.o |
|
122 del $(BUILD_TARGET) |
|
123 del $(BUILD_DIR)\$(E32UID_DIR)\*.o |
|
124 del $(BUILD_DIR)\$(HOST_DIR)\*.o |
|
125 del $(BUILD_DIR)\$(E32IMGAE_DIR)\*.o |
|
126 del $(BUILD_DIR)\$(E32IMGAE_DIR)\deflate\*.o |
|
127 del $(BUILD_DIR)\$(COMPRESS_DIR)\*.o |
|
128 |
|
129 #------------------------------------------------------------------------ |
|
130 # .PHONY |
|
131 #------------------------------------------------------------------------ |
|
132 .PHONY: all clean test |
|
133 |
|
134 $(BUILD_DIR): |
|
135 mkdir $(BUILD_DIR) |
|
136 mkdir $(BUILD_DIR)\$(E32UID_DIR) |
|
137 mkdir $(BUILD_DIR)\$(HOST_DIR) |
|
138 mkdir $(BUILD_DIR)\$(E32IMGAE_DIR) |
|
139 mkdir $(BUILD_DIR)\$(E32IMGAE_DIR)\deflate |
|
140 mkdir $(BUILD_DIR)\$(COMPRESS_DIR) |
|
141 |