symbian-qemu-0.9.1-12/model-libraries/nvmemmory/target.mak
branchgraphics-phase-3
changeset 113 b842c0cb760e
parent 112 b6c206049d8a
child 114 19c4533e1567
equal deleted inserted replaced
112:b6c206049d8a 113:b842c0cb760e
     1 # Copyright (c) 2010 Symbian Foundation.
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of the License "Eclipse Public License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Mike Kinghan, mikek@symbian.org, for Symbian Foundation - Initial contribution
       
    10 # 
       
    11 # Description:
       
    12 # Bottom level Makefile to build libnvmemmory.so in the current directory
       
    13 
       
    14 include ../../../qemu-symbian-svp/config-host.mak
       
    15 
       
    16 sources := nvmemmory.cpp
       
    17 objs := nvmemmory.o
       
    18 libname := libnvmemmory.so
       
    19 soname := $(libname).1
       
    20 targ := $(soname).0
       
    21  
       
    22 .phony: all build clean install distclean uninstall
       
    23 
       
    24 cflags=-DHAVE_STDINT_H -DNVMEMORY_EXPORTS
       
    25 ifneq ($(DEBUG_LIBS),)
       
    26 cflags+="-O0 -g"
       
    27 else
       
    28 cflags+=-O2
       
    29 endif
       
    30 
       
    31 vpath %.cpp ..
       
    32 
       
    33 all: $(targ)
       
    34 
       
    35 %.o : %.cpp
       
    36 	g++ $(cflags) -fPIC -I../../commoninc -c -o $@ $<
       
    37 
       
    38 $(objs): $(sources)
       
    39 
       
    40 $(targ): $(objs)
       
    41 	g++ $(cflags) -shared -Wl,-soname,$(soname) -Wl,-l,stdc++ -o $@ $(objs)
       
    42 
       
    43 clean:
       
    44 	rm -f $(objs) $(targ)
       
    45 
       
    46 install: $(targ)
       
    47 	if [ ! -d "$(DESTDIR)$(libdir)" ]; then mkdir -p "$(DESTDIR)$(libdir)"; fi && \
       
    48 	$(INSTALL) -m 755 $(targ) "$(DESTDIR)$(libdir)" && \
       
    49 	rm -f "$(DESTDIR)$(libdir)/$(libname)" && \
       
    50 	ln -s "$(DESTDIR)$(libdir)/$(targ)" "$(DESTDIR)$(libdir)/$(libname)"
       
    51 
       
    52 distclean: clean
       
    53 #	Nothing for distclean
       
    54 
       
    55 uninstall:
       
    56 	rm -f "$(DESTDIR)$(libdir)/$(libname)" "$(DESTDIR)$(libdir)/$(targ)" && \
       
    57 	files=`ls -A "$(DESTDIR)$(libdir)"` && \
       
    58 	if [ -z "$$files" ]; then rmdir "$(DESTDIR)$(libdir)"; fi
       
    59 
       
    60 
       
    61