imgtools/romtools/rofsbuild/rofsbuild_mingw.mk
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     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\rofsbuild
       
    20 BUILD_DIR = $(BASE_DIR)\build\romtools\rofsbuild
       
    21 RELEASE_DIR = $(BASE_DIR)\build
       
    22 SOURCE_DIR = $(BASE_DIR)
       
    23 IMGLIB_DIR = ..\..\imglib
       
    24 HOST_DIR = $(IMGLIB_DIR)\host
       
    25 E32UID_DIR = $(IMGLIB_DIR)\e32uid
       
    26 E32IMAGE_DIR = $(IMGLIB_DIR)\e32image
       
    27 COMPRESS_DIR = $(IMGLIB_DIR)\compress
       
    28 #------------------------------------------------------------------------
       
    29 # Target and Source File Specifiers
       
    30 #------------------------------------------------------------------------
       
    31 TARGET = rofsbuild.exe
       
    32 SOURCE = r_obey.cpp \
       
    33          r_build.cpp \
       
    34          r_rofs.cpp \
       
    35          r_driveimage.cpp \
       
    36          r_driveutl.cpp \
       
    37          rofsbuild.cpp \
       
    38          r_coreimage.cpp \
       
    39          r_smrimage.cpp \
       
    40          $(HOST_DIR)\h_utl.cpp \
       
    41          $(HOST_DIR)\h_file.cpp \
       
    42          $(HOST_DIR)\h_mem.cpp \
       
    43          $(E32UID_DIR)\e32uid.cpp \
       
    44          $(E32IMAGE_DIR)\e32image.cpp \
       
    45          $(E32IMAGE_DIR)\deflate\decode.cpp \
       
    46          $(E32IMAGE_DIR)\deflate\encode.cpp \
       
    47          $(E32IMAGE_DIR)\deflate\deflate.cpp \
       
    48          $(E32IMAGE_DIR)\deflate\inflate.cpp \
       
    49          $(E32IMAGE_DIR)\deflate\panic.cpp \
       
    50          $(E32IMAGE_DIR)\deflate\compress.cpp \
       
    51          $(COMPRESS_DIR)\byte_pair.cpp \
       
    52          $(COMPRESS_DIR)\pagedcompress.cpp \
       
    53          
       
    54 #------------------------------------------------------------------------
       
    55 # C++ Compiler Options
       
    56 #------------------------------------------------------------------------
       
    57 CC = \epoc32\gcc_mingw\bin\g++
       
    58 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\"
       
    59 #CC_FLAGS =-g3 -O0 -w -Wall -c -mthreads
       
    60 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
       
    61 USER_INCLUDE_DIR = $(BASE_DIR)\$(IMGLIB_DIR)\inc $(BASE_DIR)\$(COMPRESS_DIR) \
       
    62               $(BASE_DIR)\$(IMGLIB_DIR)\filesystem\include \
       
    63               $(BASE_DIR)\$(IMGLIB_DIR)\patchdataprocessor\include \
       
    64               $(BASE_DIR)\$(IMGLIB_DIR)\parameterfileprocessor\include \
       
    65               $(BASE_DIR)\$(IMGLIB_DIR)\memmap\include \
       
    66               $(BASE_DIR)\$(IMGLIB_DIR)\boostlibrary \
       
    67               
       
    68 CC_INCLUDES = $(SOURCE_DIR) $(USER_INCLUDE_DIR) 
       
    69 SYSTEM_INCLUDE_DIR = "${EPOCROOT}epoc32\include\tools\stlport" \
       
    70                   "${EPOCROOT}epoc32\include" \
       
    71                   "${EPOCROOT}epoc32\include\variant" \
       
    72                   "${EPOCROOT}epoc32\include\tools\stlport"
       
    73 CC_FLAGS_INCLUDES_SYSTEM = $(addprefix -isystem, $(SYSTEM_INCLUDE_DIR))  
       
    74 CC_FLAGS_INCLUDES_FILE = -include "${EPOCROOT}epoc32\include\gcc_mingw\gcc_mingw.h" 
       
    75 CC_OPTIONS = $(addprefix -D, $(CC_DEFINES)) \
       
    76 	     $(addprefix -I, $(CC_INCLUDES)) \
       
    77 		 $(CC_FLAGS) \
       
    78 		 $(CC_FLAGS_INCLUDES_SYSTEM) \
       
    79 		 $(CC_FLAGS_INCLUDES_FILE)  
       
    80 
       
    81 #------------------------------------------------------------------------
       
    82 # Object Files, derived from source
       
    83 #------------------------------------------------------------------------
       
    84 BUILD_TARGET = $(addprefix $(RELEASE_DIR)\,$(TARGET))
       
    85 OBJECT_FILES = $(addprefix $(BUILD_DIR)\,$(SOURCE:.cpp=.o))
       
    86 SOURCE_FILES = $(addprefix $(SOURCE_DIR)\,$(SOURCE))
       
    87 
       
    88 #------------------------------------------------------------------------
       
    89 # Principal and default target
       
    90 #------------------------------------------------------------------------
       
    91 all: $(BUILD_DIR) $(BUILD_TARGET)
       
    92 
       
    93 #------------------------------------------------------------------------
       
    94 # Link Stage
       
    95 #------------------------------------------------------------------------
       
    96 LINK_LIB_DIR = $(EPOCROOT)epoc32\release\tools2\deb
       
    97 LINK_OPTIONS = -L$(LINK_LIB_DIR) -L$(BASE_DIR) 
       
    98 LINK_STATIC_LIB = filesystem patchdataprocessor parameterfileprocessor memmap
       
    99 LINK_SYSTEM_LIB = stlport.5.1 boost_thread-mgw34-mt-1_39_win32 
       
   100 LINK_LIB_OPTIONS = $(addprefix -l, $(LINK_STATIC_LIB)) $(addprefix -l, $(LINK_SYSTEM_LIB)) 
       
   101 	
       
   102 $(BUILD_TARGET) : $(OBJECT_FILES)
       
   103 	$(CC) $(LINK_OPTIONS) -o$@ $^ -Wl,-Bstatic  $(LINK_LIB_OPTIONS)  
       
   104 
       
   105 #------------------------------------------------------------------------
       
   106 # Object File Compilation
       
   107 #------------------------------------------------------------------------
       
   108 $(OBJECT_FILES): $(BUILD_DIR)\\%.o: $(SOURCE_DIR)\\%.cpp
       
   109 	$(CC) $(CC_OPTIONS) $< -o $@
       
   110 
       
   111 #------------------------------------------------------------------------
       
   112 # CLEAN
       
   113 #------------------------------------------------------------------------
       
   114 clean: 
       
   115 	del $(BUILD_DIR)\*.o
       
   116 	del $(BUILD_TARGET)
       
   117 	del $(BUILD_DIR)\$(E32UID_DIR)\*.o
       
   118 	del $(BUILD_DIR)\$(HOST_DIR)\*.o
       
   119 	del $(BUILD_DIR)\$(E32IMAGE_DIR)\*.o
       
   120 	del $(BUILD_DIR)\$(E32IMAGE_DIR)\deflate\*.o
       
   121 	del $(BUILD_DIR)\$(COMPRESS_DIR)\*.o
       
   122 	
       
   123 #------------------------------------------------------------------------
       
   124 # .PHONY
       
   125 #------------------------------------------------------------------------
       
   126 .PHONY: all clean test
       
   127 
       
   128 $(BUILD_DIR):
       
   129 	mkdir $(BUILD_DIR) 
       
   130 	mkdir $(BUILD_DIR)\$(E32UID_DIR)
       
   131 	mkdir $(BUILD_DIR)\$(HOST_DIR)
       
   132 	mkdir $(BUILD_DIR)\$(E32IMAGE_DIR)\deflate
       
   133 	mkdir $(BUILD_DIR)\$(COMPRESS_DIR)