symbian-qemu-0.9.1-12/model-libraries/nvmemmory/target.mak
author Gareth Stockwell <gareth.stockwell@accenture.com>
Thu, 09 Sep 2010 12:06:21 +0100
changeset 108 78b83e1454a6
parent 95 285922d13199
permissions -rw-r--r--
Allow NVM device to be built with MinGW
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
94
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     1
# Copyright (c) 2010 Symbian Foundation.
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     2
# All rights reserved.
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     3
# This component and the accompanying materials are made available
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     4
# under the terms of the License "Eclipse Public License v1.0"
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     5
# which accompanies this distribution, and is available
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     7
#
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     8
# Initial Contributors:
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
     9
# Mike Kinghan, mikek@symbian.org, for Symbian Foundation - Initial contribution
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    10
# 
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    11
# Description:
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    12
# Bottom level Makefile to build libnvmemmory.so in the current directory
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    13
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    14
include ../../../qemu-symbian-svp/config-host.mak
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    15
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    16
sources := nvmemmory.cpp
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    17
objs := nvmemmory.o
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    18
libname := libnvmemmory.so
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    19
soname := $(libname).1
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    20
targ := $(soname).0
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    21
 
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    22
.phony: all build clean install distclean uninstall
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    23
108
78b83e1454a6 Allow NVM device to be built with MinGW
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 95
diff changeset
    24
cflags=-DHAVE_STDINT_H -DNVMEMORY_EXPORTS
94
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    25
ifneq ($(DEBUG_LIBS),)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    26
cflags+="-O0 -g"
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    27
else
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    28
cflags+=-O2
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    29
endif
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    30
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    31
vpath %.cpp ..
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    32
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    33
all: $(targ)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    34
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    35
%.o : %.cpp
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    36
	g++ $(cflags) -fPIC -I../../commoninc -c -o $@ $<
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    37
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    38
$(objs): $(sources)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    39
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    40
$(targ): $(objs)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    41
	g++ $(cflags) -shared -Wl,-soname,$(soname) -Wl,-l,stdc++ -o $@ $(objs)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    42
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    43
clean:
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    44
	rm -f $(objs) $(targ)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    45
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    46
install: $(targ)
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    47
	if [ ! -d "$(DESTDIR)$(libdir)" ]; then mkdir -p "$(DESTDIR)$(libdir)"; fi && \
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    48
	$(INSTALL) -m 755 $(targ) "$(DESTDIR)$(libdir)" && \
95
285922d13199 Correction for the fix for Bug 3508 - Persistent storage support breaks Linux compatibility.
Mike Kinghan <mikek@symbian.org>
parents: 94
diff changeset
    49
	rm -f "$(DESTDIR)$(libdir)/$(libname)" && \
94
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    50
	ln -s "$(DESTDIR)$(libdir)/$(targ)" "$(DESTDIR)$(libdir)/$(libname)"
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    51
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    52
distclean: clean
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    53
#	Nothing for distclean
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    54
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    55
uninstall:
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    56
	rm -f "$(DESTDIR)$(libdir)/$(libname)" "$(DESTDIR)$(libdir)/$(targ)" && \
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    57
	files=`ls -A "$(DESTDIR)$(libdir)"` && \
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    58
	if [ -z "$$files" ]; then rmdir "$(DESTDIR)$(libdir)"; fi
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    59
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    60
c5cd29a4600d Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Mike Kinghan <mikek@symbian.org>
parents:
diff changeset
    61