makefiles-garage/imgtools/romtools/rombuild/Makefile
author mikek
Fri, 08 Jan 2010 16:16:51 +0000
changeset 1 820b22e13ff1
parent 0 37428ad74fc2
permissions -rw-r--r--
Commit further implemented Linux makefiles
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2009 Symbian Foundation Ltd
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     2
# This component and the accompanying materials are made available
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     3
# under the terms of the License "Eclipse Public License v1.0"
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     4
# which accompanies this distribution, and is available
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     5
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     6
#
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     7
# Initial Contributors:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     8
# Symbian Foundation Ltd - initial contribution.
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     9
# Mike Kinghan, mikek@symbian.org
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    10
#
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    11
# Contributors:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    12
#
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    13
# Description:
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    14
# This is a Linux makefile for rombuild. 
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    15
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    16
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    17
ifdef EPOCROOT
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    18
include $(EPOCROOT)/build/makefiles-garage/global-make-env.mk
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    19
else
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    20
$(error EPOCROOT must be defined as the parent directory of your epoc32 tree)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    21
endif
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    22
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    23
cpp_inc_paths = \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    24
-I ../../imglib/compress \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    25
-I ../../imglib/inc \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    26
-I ../../imglib/patchdataprocessor/include \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    27
-I ../../imglib/parameterfileprocessor/include \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    28
-I ../../imglib/memmap/include
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    29
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    30
lib_opts = -lboost_thread-mt \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    31
-L../../imglib/memmap -lmemmap \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    32
-L../../imglib/patchdataprocessor -lpatchdataprocessor \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    33
-L../../imglib/parameterfileprocessor -lparameterfileprocessor \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    34
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    35
exe = rombuild
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    36
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    37
CPPFLAGS = $(cpp_inc_paths) $(global_cpp_flags)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    38
LDFLAGS = $(lib_opts) $(global_ld_flags)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    39
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    40
prereqs = memmap patchdataprocessor parameterfileprocessor
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    41
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    42
srcs = r_dir.cpp r_header.cpp r_obey.cpp r_srec.cpp r_rom.cpp rombuild.cpp r_build.cpp r_collapse.cpp r_global.cpp r_areaset.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    43
r_coreimage.cpp r_coreimagereader.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    44
../../imglib/e32uid/e32uid.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    45
../../imglib/host/h_file.cpp ../../imglib/host/h_mem.cpp ../../imglib/host/h_utl.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    46
../../imglib/e32image/e32image.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    47
../../imglib/e32image/deflate/decode.cpp ../../imglib/e32image/deflate/encode.cpp ../../imglib/e32image/deflate/deflate.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    48
../../imglib/e32image/deflate/inflate.cpp ../../imglib/e32image/deflate/panic.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    49
../../imglib/e32image/deflate/compress.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    50
../../imglib/compress/byte_pair.cpp \
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    51
../../imglib/compress/pagedcompress.cpp
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    52
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    53
fixfiles = rombuild.cpp r_global.cpp r_global.h
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    54
fixbackups = $(addsuffix .original,$(fixfiles)) 
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    55
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    56
.PHONY: all clean $(prereqs) fixes remove_fixes
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    57
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    58
all: $(exe)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    59
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    60
$(srcs): fixes
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    61
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    62
bases = $(basename $(srcs))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    63
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    64
objs = $(addsuffix .o,$(bases))
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    65
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    66
$(prereqs): $(global_prereqs)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    67
	$(MAKE) -C $(EPOCROOT)/build $@
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    68
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    69
$(objs): $(prereqs)
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    70
 
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    71
$(exe): $(objs) 
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    72
	$(CC) -o $@ $(objs) $(LDFLAGS)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    73
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    74
clean: remove_fixes
0
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    75
	rm -f $(objs) $(exe)
37428ad74fc2 Initial commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    76
1
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    77
fixes:: $(fixbackups)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    78
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    79
rombuild.cpp.original:
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    80
	cp $(basename $@) $@ && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    81
	sed -e 's|^TInt gCPUNum = 0;||g' \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    82
		-e 's|TInt gThreadNum = 0;||g' \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    83
		-e 's|char\* g_pCharCPUNum = NULL;||g' \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    84
		-e 's|TBool gGenDepGraph = EFalse;||g' \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    85
		-e 's|char\* gDepInfoFile = NULL;||g' -i $(basename $@)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    86
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    87
r_global.cpp.original:
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    88
	cp $(basename $@) $@ && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    89
	printf "TInt gCPUNum = 0;\nTInt gThreadNum = 0;\nchar* g_pCharCPUNum = NULL;\nTBool gGenDepGraph = EFalse;\nchar* gDepInfoFile = NULL;\n" >> $(basename $@)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    90
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    91
r_global.h.original:
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    92
	cp $(basename $@) $@ && \
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    93
	sed '/^extern TInt gPageIndexTableSize/a\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    94
extern TInt gCPUNum;\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    95
extern TInt gThreadNum;\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    96
extern char* g_pCharCPUNum;\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    97
extern TBool gGenDepGraph;\
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    98
extern char* gDepInfoFile;'  -i $(basename $@)
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
    99
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   100
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   101
remove_fixes: 
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   102
	for file in $(fixbackups); do if [ -f $$file ]; then mv -f $$file $${file%\.original}; fi; done
820b22e13ff1 Commit further implemented Linux makefiles
mikek
parents: 0
diff changeset
   103