makefiles-garage/imgtools/imgcheck/Makefile
changeset 0 37428ad74fc2
child 1 820b22e13ff1
equal deleted inserted replaced
-1:000000000000 0:37428ad74fc2
       
     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 imgcheck .
       
    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 prereqs = patchdataprocessor libimgutils
       
    23 
       
    24 .PHONY: all clean fixes remove_fixes $(prereqs)
       
    25 
       
    26 cpp_inc_paths = -I . -I .libxml  -I ../imglib/inc -I ../romtools/rofsbuild \
       
    27 -I libimgutils/inc -I inc -I ../imglib/compress
       
    28 
       
    29 lib_opts = -lxml2 -L libimgutils -limgutils -L ../imglib/patchdataprocessor -lpatchdataprocessor
       
    30 
       
    31 exe = imgcheck
       
    32 
       
    33 CPPFLAGS = $(cpp_inc_paths) $(global_cpp_flags)
       
    34 CXXFLAGS = $(global_cxx_flags) -pthread
       
    35 LDFLAGS = $(global_ld_flags) $(lib_opts)
       
    36 
       
    37 srcs = src/cmdlinehandler.cpp src/depchecker.cpp src/hash.cpp src/main.cpp \
       
    38 src/imgcheckmanager.cpp src/sidchecker.cpp src/vidchecker.cpp src/common.cpp src/checker.cpp src/reporter.cpp \
       
    39 src/exceptionimplementation.cpp src/exceptionreporter.cpp \
       
    40 src/cmdlinewriter.cpp src/xmlwriter.cpp src/dbgflagchecker.cpp
       
    41  
       
    42 bases = $(basename $(srcs))
       
    43 
       
    44 objs = $(addsuffix .o,$(bases))
       
    45 
       
    46 fixfiles = inc/exceptionimplementation.h inc/xmlwriter.h src/exceptionimplementation.cpp src/xmlwriter.cpp
       
    47 fixbackups = $(addsuffix .original,$(fixfiles))
       
    48 
       
    49 all: $(exe)
       
    50 
       
    51 $(srcs): fixes 
       
    52 
       
    53 $(prereqs): $(global_prereqs)
       
    54 	$(MAKE) -C $(EPOCROOT)/build $@
       
    55 
       
    56 $(exe): $(objs) $(prereqs)
       
    57 	$(CC) -o $@ $(objs) $(LDFLAGS)
       
    58 
       
    59 clean: remove_fixes
       
    60 	rm -f $(objs) $(exe)
       
    61 	for file in $(subdirs); do $(MAKE) -C $$file clean; done
       
    62 
       
    63 fixes: $(fixbackups)
       
    64 	
       
    65 inc/exceptionimplementation.h.original:
       
    66 	cp $(basename $@) $@ && \
       
    67 	sed -e 's|ofstream iLogStream;|Ofstream iLogStream;|g' -i $(basename $@)
       
    68 
       
    69 inc/xmlwriter.h.original:
       
    70 	cp $(basename $@) $@ && \
       
    71 	sed -e 's|ofstream iXmlFile;|Ofstream iXmlFile;|g' -i $(basename $@)
       
    72 
       
    73 src/exceptionimplementation.cpp.original:
       
    74 	cp $(basename $@) $@ && \
       
    75 	sed '/#include "exceptionimplementation.h"/ a\
       
    76 using namespace std;' -i $(basename $@)
       
    77 
       
    78 src/xmlwriter.cpp.original:
       
    79 	cp $(basename $@) $@ && \
       
    80 	sed -e 's|ifstream xslSourceHandle;|Ifstream xslSourceHandle;|g' \
       
    81 		-e 's|ofstream xslDestHandle|Ofstream xslDestHandle|g' -i $(basename $@)
       
    82 
       
    83 remove_fixes: 
       
    84 	for file in $(fixbackups); do if [ -f $$file ]; then mv -f $$file $${file%original}; fi; done
       
    85