symbian-qemu-0.9.1-12/model-libraries/nvmemmory/target.mak
author Mike Kinghan <mikek@symbian.org>
Wed, 04 Aug 2010 11:52:10 +0100
branchGCC_SURGE
changeset 92 c5cd29a4600d
child 93 285922d13199
permissions -rw-r--r--
Fix for bug 3508 - Persistent storage support breaks Linux compatibility. Part 2. Neglected to include added files in first commit.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
92
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
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
    24
cflags=-DHAVE_STDINT_H
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)" && \
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
    49
	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
    50
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
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
    52
#	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
    53
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
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
    55
	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
    56
	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
    57
	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
    58
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