makefiles-garage/bintools/elftools/elftran/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 elftran. 
       
    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 cpp_inc_paths = \
       
    23 -I ../inc \
       
    24 -I ../../../e32tools/e32lib/e32image/inc \
       
    25 -I ../../../imgtools/imglib/compress \
       
    26 -I $(EPOCROOT)/epoc32/include/tools
       
    27 
       
    28 lib_opts =
       
    29 
       
    30 exe = elftran
       
    31 
       
    32 CPPFLAGS = -D__SUPPORT_ELF_FILES__ $(cpp_inc_paths) $(global_cpp_flags)
       
    33 LDFLAGS = $(lib_opts) $(global_ld_flags)
       
    34 
       
    35 prereqs =
       
    36 
       
    37 srcs = elf_file.cpp elf_dlld.cpp elf_imp.cpp elf_reloc.cpp elf_tran.cpp \
       
    38 ../../../imgtools/imglib/e32uid/e32uid.cpp \
       
    39 ../../../imgtools/imglib/host/h_file.cpp \
       
    40 ../../../imgtools/imglib/host/h_mem.cpp \
       
    41 ../../../imgtools/imglib/host/h_utl.cpp \
       
    42 ../../../e32tools/e32lib/e32image/e32image.cpp \
       
    43 ../../../e32tools/e32lib/e32image/tr_main.cpp \
       
    44 ../../../e32tools/e32lib/e32image/imgdump.cpp \
       
    45 ../../../e32tools/e32lib/e32image/deflate/decode.cpp \
       
    46 ../../../e32tools/e32lib/e32image/deflate/encode.cpp \
       
    47 ../../../e32tools/e32lib/e32image/deflate/deflate.cpp \
       
    48 ../../../e32tools/e32lib/e32image/deflate/inflate.cpp \
       
    49 ../../../e32tools/e32lib/e32image/deflate/panic.cpp \
       
    50 ../../../e32tools/e32lib/e32image/deflate/compress.cpp \
       
    51 ../../../imgtools/imglib/compress/byte_pair.cpp \
       
    52 ../../../imgtools/imglib/compress/pagedcompress.cpp
       
    53 
       
    54 fixfiles = ../inc/e32ldfmt.h
       
    55 fixbackups = $(addsuffix .original,$(fixfiles)) 
       
    56  
       
    57 .PHONY: all clean $(prereqs)
       
    58 
       
    59 all: $(exe)
       
    60 
       
    61 $(srcs): fixes
       
    62 
       
    63 bases = $(basename $(srcs))
       
    64 
       
    65 objs = $(addsuffix .o,$(bases))
       
    66 
       
    67 $(prereqs): $(global_prereqs)
       
    68 	$(MAKE) -C $(EPOCROOT)/build $@
       
    69  
       
    70 $(exe): $(objs) $(prereqs)
       
    71 	$(CC) -o $@ $(objs) $(LDFLAGS)
       
    72 
       
    73 clean: remove_fixes
       
    74 	rm -f $(objs) $(exe)
       
    75 
       
    76 fixes: $(fixbackups)
       
    77 
       
    78 remove_fixes: 
       
    79 	for file in $(fixbackups); do if [ -f $$file ]; then mv -f $$file $${file%original}; fi; done
       
    80 
       
    81 ../inc/e32ldfmt.h.original:
       
    82 	cp $(basename $@) $@ && \
       
    83 	sed -e 's|fstream.h|fstream|g' -i $(basename $@)
       
    84