~ubuntu-branches/ubuntu/vivid/jayatana/vivid

« back to all changes in this revision

Viewing changes to libjayatana/Makefile

  • Committer: Package Import Robot
  • Author(s): Jared González
  • Date: 2014-12-10 17:38:15 UTC
  • Revision ID: package-import@ubuntu.com-20141210173815-8k4hm3bd481qkt63
Tags: upstream-2.7
Import upstream version 2.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (c) 2014 Jared González
 
2
#
 
3
# Permission is hereby granted, free of charge, to any
 
4
# person obtaining a copy of this software and associated
 
5
# documentation files (the "Software"), to deal in the
 
6
# Software without restriction, including without limitation
 
7
# the rights to use, copy, modify, merge, publish,
 
8
# distribute, sublicense, and/or sell copies of the
 
9
# Software, and to permit persons to whom the Software is
 
10
# furnished to do so, subject to the following conditions:
 
11
#
 
12
# The above copyright notice and this permission notice
 
13
# shall be included in all copies or substantial portions of
 
14
# the Software.
 
15
#
 
16
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
 
17
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 
18
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 
19
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
 
20
# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
21
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 
22
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 
23
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
24
 
 
25
# CONFIGURACION DEL COMPILADOR
 
26
# Se define el compilador gcc
 
27
CC=gcc
 
28
# Se configuran las banderas y opciones de compilación
 
29
# de forma predeterminada se compila en Release
 
30
ifeq ($(BUILD),debug)
 
31
CFLAGS=-O0 -g -Wall
 
32
else
 
33
CFLAGS=-O3 -Wall -DNDEBUG
 
34
endif
 
35
 
 
36
# CONFIGURACION DE JAVA
 
37
# Obtener arquitectura de compilación
 
38
ARCH=$(shell getconf LONG_BIT)
 
39
ifeq (${ARCH},64)
 
40
JAVA_ARCH=amd64
 
41
else
 
42
JAVA_ARCH=i386
 
43
endif
 
44
# Obtener versión Java de compilación
 
45
ifndef JAVA_HOME
 
46
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-${JAVA_ARCH}
 
47
endif
 
48
# Eliminar la variable de ambiente JAVA_TOOL_OPTIONS
 
49
unexport JAVA_TOOL_OPTIONS
 
50
 
 
51
# ESTABLECER VARIABLES DE COMPILACION DE JAYATANA
 
52
# se definen banderas de compilacion
 
53
JAYATANA_CFLAGS=-I. -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux \
 
54
        $(shell pkg-config --cflags glib-2.0 gio-2.0 dbusmenu-glib-0.4 xt) \
 
55
        -L${JAVA_HOME}/jre/lib/${JAVA_ARCH} -L${JAVA_HOME}/jre/lib/${JAVA_ARCH}/xawt
 
56
# se definen librerias
 
57
JAYATANA_LIBS=$(shell pkg-config --libs glib-2.0 gio-2.0 dbusmenu-glib-0.4 xt) \
 
58
        -ljawt -lmawt
 
59
 
 
60
# compilar
 
61
all: libjayatana.so
 
62
 
 
63
libjayatana.so: com_jarego_jayatana_basic_GMainLoop.o com_jarego_jayatana_basic_GlobalMenu.o \
 
64
                com_jarego_jayatana_jni.o com_jarego_jayatana_collections.o com_jarego_jayatana_jkey2xkey.o
 
65
        ${CC} ${CFLAGS} ${JAYATANA_CFLAGS} -shared -o $@ $+ ${JAYATANA_LIBS}
 
66
        
 
67
%.o: %.c %.h
 
68
        ${CC} ${CFLAGS} ${JAYATANA_CFLAGS} -fPIC -c -o $@ $< ${JAYATANA_LIBS}
 
69
 
 
70
javah:
 
71
        ${JAVA_HOME}/bin/javah -classpath ../jayatana/target/classes \
 
72
                com.jarego.jayatana.basic.GMainLoop
 
73
        ${JAVA_HOME}/bin/javah -classpath ../jayatana/target/classes \
 
74
                com.jarego.jayatana.basic.GlobalMenu
 
75
 
 
76
clean:
 
77
        rm -fr *.o *.so