Commit 7b67259ab13a320189a9a77665de4518055ee30e

Authored by Perry Werneck
1 parent 1e2ce022
Exists in master and in 1 other branch develop

Adding Makefile for client library

Fixing server testscripts path.
client/Makefile.in 0 → 100644
... ... @@ -0,0 +1,268 @@
  1 +#
  2 +# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  3 +# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  4 +# aplicativos mainframe. Registro no INPI sob o nome G3270.
  5 +#
  6 +# Copyright (C) <2008> <Banco do Brasil S.A.>
  7 +#
  8 +# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  9 +# os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  10 +# Free Software Foundation.
  11 +#
  12 +# Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  13 +# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  14 +# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  15 +# obter mais detalhes.
  16 +#
  17 +# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  18 +# programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
  19 +# Place, Suite 330, Boston, MA, 02111-1307, USA
  20 +#
  21 +# Contatos:
  22 +#
  23 +# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  24 +# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça)
  25 +#
  26 +
  27 +#---[ Library configuration ]------------------------------------------------------------
  28 +
  29 +MODULE_NAME=ipc3270d
  30 +PACKAGE_NAME=@PACKAGE_NAME@
  31 +
  32 +MAIN_SOURCES= \
  33 + $(wildcard src/core/*.cc) \
  34 + $(wildcard src/core/@OSNAME@/*.cc) \
  35 + $(wildcard src/core/@OSNAME@/*.rc) \
  36 + $(wildcard src/session/local/*.cc) \
  37 + $(wildcard src/session/remote/*.cc)
  38 +
  39 +TEST_SOURCES= \
  40 + $(wildcard src/testprogram/*.cc)
  41 +
  42 +#---[ Tools ]----------------------------------------------------------------------------
  43 +
  44 +CXX=@CXX@
  45 +LD=@CXX@
  46 +LN_S=@LN_S@
  47 +MKDIR=@MKDIR_P@
  48 +INSTALL=@INSTALL@
  49 +INSTALL_DATA=@INSTALL_DATA@
  50 +INSTALL_PROGRAM=@INSTALL_PROGRAM@
  51 +XGETTEXT=@XGETTEXT@
  52 +MSGCAT=@MSGCAT@
  53 +WINDRES=@WINDRES@
  54 +AR=@AR@
  55 +
  56 +#---[ Paths ]----------------------------------------------------------------------------
  57 +
  58 +prefix=@prefix@
  59 +exec_prefix=@exec_prefix@
  60 +bindir=@bindir@
  61 +sbindir=@sbindir@
  62 +libdir=@libdir@
  63 +includedir=@includedir@
  64 +datarootdir=@datarootdir@
  65 +localedir=@localedir@
  66 +docdir=@docdir@
  67 +sysconfdir=@sysconfdir@
  68 +
  69 +BASEDIR=@BASEDIR@
  70 +
  71 +POTDIR=$(BASEDIR)/.pot
  72 +
  73 +OBJDIR=.obj/$(MODULE_NAME)
  74 +OBJDBG=$(OBJDIR)/Debug
  75 +OBJRLS=$(OBJDIR)/Release
  76 +
  77 +BINDIR=.bin
  78 +BINDBG=$(BINDIR)/Debug
  79 +BINRLS=$(BINDIR)/Release
  80 +
  81 +#---[ Rules ]----------------------------------------------------------------------------
  82 +
  83 +DEPENDS= \
  84 + Makefile \
  85 + src/include/*.h \
  86 + $(BASEDIR)/common/src/include/*.h \
  87 + $(BASEDIR)/common/src/include/lib3270/*.h
  88 +
  89 +CFLAGS= \
  90 + @CFLAGS@ \
  91 + -I$(BASEDIR)/common/src/include \
  92 + -Isrc/include \
  93 + -DBUILD_DATE=`date +%Y%m%d` \
  94 + @LIB3270_CFLAGS@ \
  95 + @DBUS_CFLAGS@
  96 +
  97 +LIBS= \
  98 + @LIBS@ \
  99 + @LIBICONV@ \
  100 + @INTL_LIBS@ \
  101 + @LIB3270_LIBS@ \
  102 + @DBUS_LIBS@
  103 +
  104 +#---[ Debug Rules ]----------------------------------------------------------------------
  105 +
  106 +$(OBJDBG)/%.o: \
  107 + %.cc \
  108 + $(DEPENDS)
  109 +
  110 + @echo $< ...
  111 + @$(MKDIR) $(@D)
  112 +
  113 + @$(CXX) \
  114 + $(CFLAGS) \
  115 + -Wall -Wextra -fstack-check \
  116 + -DDEBUG=1 \
  117 + -o $@ \
  118 + -c $<
  119 +
  120 +$(OBJDBG)/%.o: \
  121 + %.rc
  122 +
  123 + @echo $< ...
  124 + @$(MKDIR) $(@D)
  125 + @$(WINDRES) $< -O coff -o $@
  126 +
  127 +#---[ Release Rules ]--------------------------------------------------------------------
  128 +
  129 +$(OBJRLS)/%.o: \
  130 + %.cc \
  131 + $(DEPENDS)
  132 +
  133 + @echo $< ...
  134 + @$(MKDIR) $(@D)
  135 + @$(CXX) \
  136 + $(CFLAGS) \
  137 + -DNDEBUG=1 \
  138 + -o $@ \
  139 + -c $<
  140 +
  141 +$(OBJRLS)/%.o: \
  142 + %.rc
  143 +
  144 + @echo $< ...
  145 + @$(MKDIR) $(@D)
  146 + @$(WINDRES) $< -O coff -o $@
  147 +
  148 +#---[ Misc Rules ]-----------------------------------------------------------------------
  149 +
  150 +$(POTDIR)/$(MODULE_NAME)/%.pot: \
  151 + %.cc
  152 +
  153 + @echo $(notdir $@) ...
  154 + @$(MKDIR) $(@D)
  155 + @$(XGETTEXT) \
  156 + --language=C \
  157 + --keyword=_ \
  158 + --keyword=N_ \
  159 + --keyword=MSG_:2 \
  160 + --output=$@ \
  161 + $<
  162 + @touch $@
  163 +
  164 +$(POTDIR)/$(MODULE_NAME)/%.pot: \
  165 + %.rc
  166 +
  167 + @echo $< ...
  168 + @$(MKDIR) $(@D)
  169 + @touch $@
  170 +
  171 +
  172 +#---[ Release Targets ]------------------------------------------------------------------
  173 +
  174 +all: \
  175 + $(BINRLS)/$(MODULE_NAME)@DLLEXT@ \
  176 + $(POTDIR)/$(MODULE_NAME).pot
  177 +
  178 +Release: \
  179 + $(BINRLS)/$(MODULE_NAME)@DLLEXT@
  180 +
  181 +$(BINRLS)/$(MODULE_NAME)@DLLEXT@: \
  182 + $(foreach SRC, $(basename $(MAIN_SOURCES)), $(OBJRLS)/$(SRC).o)
  183 +
  184 + @$(MKDIR) $(@D)
  185 + @echo $< ...
  186 + @$(LD) \
  187 + -shared -Wl,-soname,$(@F) \
  188 + -o $@ \
  189 + $(LDFLAGS) \
  190 + $(foreach SRC, $(basename $(MAIN_SOURCES)), $(OBJRLS)/$(SRC).o) \
  191 + $(LIBS) \
  192 + $(GTK_LIBS)
  193 +
  194 +$(BINRLS)/lib$(MODULE_NAME).a: \
  195 + $(foreach SRC, $(basename $(MAIN_SOURCES)), $(OBJRLS)/$(SRC).o)
  196 +
  197 + @$(MKDIR) $(@D)
  198 + @echo $< ...
  199 +
  200 + @$(AR) rcs $@ $^
  201 +
  202 +
  203 +#---[ Install Targets ]------------------------------------------------------------------
  204 +
  205 +#---[ Misc Targets ]---------------------------------------------------------------------
  206 +
  207 +#---[ Debug Targets ]--------------------------------------------------------------------
  208 +
  209 +Debug: \
  210 + $(BINDBG)/$(MODULE_NAME)@EXEEXT@
  211 +
  212 +$(BINDBG)/$(MODULE_NAME)@EXEEXT@: \
  213 + $(foreach SRC, $(basename $(TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \
  214 + $(BINDBG)/lib$(MODULE_NAME)@DLLEXT@
  215 +
  216 + @$(MKDIR) $(@D)
  217 + @echo $< ...
  218 + @$(LD) \
  219 + -o $@ \
  220 + $(foreach SRC, $(basename $(TEST_SOURCES)), $(OBJDBG)/$(SRC).o) \
  221 + -L$(BINDBG) -l$(MODULE_NAME)\
  222 + -Wl,-rpath,$(BINDBG) \
  223 + $(LDFLAGS) \
  224 + $(LIBS)
  225 +
  226 +
  227 +$(BINDBG)/lib$(MODULE_NAME)@DLLEXT@: \
  228 + $(foreach SRC, $(basename $(MAIN_SOURCES)), $(OBJDBG)/$(SRC).o)
  229 +
  230 + @$(MKDIR) $(@D)
  231 + @echo $< ...
  232 + @$(LD) \
  233 + -shared -Wl,-soname,$(@F) \
  234 + -o $@ \
  235 + $(LDFLAGS) \
  236 + $(foreach SRC, $(basename $(MAIN_SOURCES)), $(OBJDBG)/$(SRC).o) \
  237 + $(LIBS)
  238 +
  239 +
  240 +run: \
  241 + $(BINDBG)/$(MODULE_NAME)@EXEEXT@
  242 +
  243 + @LD_LIBRARY_PATH=$(BINDBG) \
  244 + $(BINDBG)/$(MODULE_NAME)@EXEEXT@
  245 +
  246 +#---[ Clean Targets ]--------------------------------------------------------------------
  247 +
  248 +clean: \
  249 + cleanDebug \
  250 + cleanRelease
  251 +
  252 +cleanDebug:
  253 +
  254 + @rm -fr $(OBJDBG)
  255 + @rm -fr $(BINDBG)
  256 +
  257 +cleanRelease:
  258 +
  259 + @rm -fr $(OBJRLS)
  260 + @rm -fr $(BINRLS)
  261 + @rm -fr $(POTDIR)
  262 + @rm -f $(MODULE_NAME).pot
  263 +
  264 +clean: \
  265 + cleanDebug \
  266 + cleanRelease
  267 +
  268 +
... ...
server/testscripts/callmethod.sh 0 → 100755
... ... @@ -0,0 +1,12 @@
  1 +#!/bin/bash
  2 +#
  3 +# https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
  4 +#
  5 +
  6 +dbus-send \
  7 + --session \
  8 + --dest=br.com.bb.pw3270.a\
  9 + --print-reply \
  10 + "/br/com/bb/tn3270/session" \
  11 + "br.com.bb.tn3270.session.${1}"
  12 +
... ...
server/testscripts/getproperty.sh 0 → 100755
... ... @@ -0,0 +1,14 @@
  1 +#!/bin/bash
  2 +#
  3 +# https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
  4 +#
  5 +
  6 +dbus-send \
  7 + --session \
  8 + --dest=br.com.bb.pw3270.a\
  9 + --print-reply \
  10 + "/br/com/bb/tn3270/session" \
  11 + "org.freedesktop.DBus.Properties.Get" \
  12 + string:br.com.bb.tn3270.session \
  13 + string:${1}
  14 +
... ...
server/testscripts/introspect-plugin.sh 0 → 100755
... ... @@ -0,0 +1,7 @@
  1 +#!/bin/bash
  2 +gdbus \
  3 + introspect \
  4 + --session \
  5 + --dest=br.com.bb.pw3270.a \
  6 + --object-path=/br/com/bb/tn3270/session
  7 +
... ...
server/testscripts/introspect-service.sh 0 → 100755
... ... @@ -0,0 +1,7 @@
  1 +#!/bin/bash
  2 +gdbus \
  3 + introspect \
  4 + --session \
  5 + --dest=br.com.bb.tn3270.service \
  6 + --object-path=/br/com/bb/tn3270/service
  7 +
... ...
server/testscripts/setstring.sh 0 → 100755
... ... @@ -0,0 +1,13 @@
  1 +#!/bin/bash
  2 +#
  3 +# https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
  4 +#
  5 +
  6 +dbus-send \
  7 + --session \
  8 + --dest=br.com.bb.pw3270.a\
  9 + --print-reply \
  10 + "/br/com/bb/tn3270/session" \
  11 + "br.com.bb.tn3270.session.setString" \
  12 + string:${1}
  13 +
... ...
testscripts/callmethod.sh
... ... @@ -1,12 +0,0 @@
1   -#!/bin/bash
2   -#
3   -# https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
4   -#
5   -
6   -dbus-send \
7   - --session \
8   - --dest=br.com.bb.pw3270.a\
9   - --print-reply \
10   - "/br/com/bb/tn3270/session" \
11   - "br.com.bb.tn3270.session.${1}"
12   -
testscripts/getproperty.sh
... ... @@ -1,14 +0,0 @@
1   -#!/bin/bash
2   -#
3   -# https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
4   -#
5   -
6   -dbus-send \
7   - --session \
8   - --dest=br.com.bb.pw3270.a\
9   - --print-reply \
10   - "/br/com/bb/tn3270/session" \
11   - "org.freedesktop.DBus.Properties.Get" \
12   - string:br.com.bb.tn3270.session \
13   - string:${1}
14   -
testscripts/introspect-plugin.sh
... ... @@ -1,7 +0,0 @@
1   -#!/bin/bash
2   -gdbus \
3   - introspect \
4   - --session \
5   - --dest=br.com.bb.pw3270.a \
6   - --object-path=/br/com/bb/tn3270/session
7   -
testscripts/introspect-service.sh
... ... @@ -1,7 +0,0 @@
1   -#!/bin/bash
2   -gdbus \
3   - introspect \
4   - --session \
5   - --dest=br.com.bb.tn3270.service \
6   - --object-path=/br/com/bb/tn3270/service
7   -
testscripts/setstring.sh
... ... @@ -1,13 +0,0 @@
1   -#!/bin/bash
2   -#
3   -# https://stackoverflow.com/questions/48648952/set-get-property-using-dbus-send
4   -#
5   -
6   -dbus-send \
7   - --session \
8   - --dest=br.com.bb.pw3270.a\
9   - --print-reply \
10   - "/br/com/bb/tn3270/session" \
11   - "br.com.bb.tn3270.session.setString" \
12   - string:${1}
13   -