From 891f35cb2686c8b6135b42621e4aab9ce6e64e53 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 2 Aug 2015 00:28:26 -0300 Subject: [PATCH] =?utf8?q?Separa=20c=C3=B3digo=20em=20diret=C3=B3rios.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit src contém o código de programas, lib contém código utilizado pelos programas, na forma do libreceita, e test contém os testes a serem realizados. --- Makefile.am | 19 +------------------ bootstrap.sh | 1 + configure.ac | 3 ++- lib/Makefile.am | 13 +++++++++++++ base.c => lib/base.c | 0 base.h => lib/base.h | 0 calcula.c => lib/calcula.c | 0 calcula.h => lib/calcula.h | 0 cmd.c => lib/cmd.c | 0 cmd.h => lib/cmd.h | 0 contribuinte.c => lib/contribuinte.c | 0 contribuinte.h => lib/contribuinte.h | 0 declaracao.c => lib/declaracao.c | 0 declaracao.h => lib/declaracao.h | 0 gera.c => lib/gera.c | 0 gera.h => lib/gera.h | 0 list.c => lib/list.c | 0 list.h => lib/list.h | 0 pagamento.c => lib/pagamento.c | 0 pagamento.h => lib/pagamento.h | 0 pmhash.c => lib/pmhash.c | 0 pmhash.h => lib/pmhash.h | 0 rendimento.c => lib/rendimento.c | 0 rendimento.h => lib/rendimento.h | 0 token.c => lib/token.c | 0 token.h => lib/token.h | 0 totais.c => lib/totais.c | 0 totais.h => lib/totais.h | 0 util.c => lib/util.c | 0 util.h => lib/util.h | 0 src/Makefile.am | 7 +++++++ declara.c => src/declara.c | 0 test/Makefile.am | 6 ++++++ listtest.c => test/listtest.c | 0 34 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 lib/Makefile.am rename base.c => lib/base.c (100%) rename base.h => lib/base.h (100%) rename calcula.c => lib/calcula.c (100%) rename calcula.h => lib/calcula.h (100%) rename cmd.c => lib/cmd.c (100%) rename cmd.h => lib/cmd.h (100%) rename contribuinte.c => lib/contribuinte.c (100%) rename contribuinte.h => lib/contribuinte.h (100%) rename declaracao.c => lib/declaracao.c (100%) rename declaracao.h => lib/declaracao.h (100%) rename gera.c => lib/gera.c (100%) rename gera.h => lib/gera.h (100%) rename list.c => lib/list.c (100%) rename list.h => lib/list.h (100%) rename pagamento.c => lib/pagamento.c (100%) rename pagamento.h => lib/pagamento.h (100%) rename pmhash.c => lib/pmhash.c (100%) rename pmhash.h => lib/pmhash.h (100%) rename rendimento.c => lib/rendimento.c (100%) rename rendimento.h => lib/rendimento.h (100%) rename token.c => lib/token.c (100%) rename token.h => lib/token.h (100%) rename totais.c => lib/totais.c (100%) rename totais.h => lib/totais.h (100%) rename util.c => lib/util.c (100%) rename util.h => lib/util.h (100%) create mode 100644 src/Makefile.am rename declara.c => src/declara.c (100%) create mode 100644 test/Makefile.am rename listtest.c => test/listtest.c (100%) diff --git a/Makefile.am b/Makefile.am index b0bea0d..128d61e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,18 +1 @@ -bin_PROGRAMS = declara -declara_SOURCES = declara.c declaracao.c declaracao.h \ - token.c token.h \ - cmd.c cmd.h pmhash.c pmhash.h \ - totais.c totais.h \ - calcula.c calcula.h \ - gera.c gera.h \ - base.c base.h \ - list.c list.h \ - util.c util.h \ - contribuinte.c contribuinte.h \ - rendimento.c rendimento.h \ - pagamento.c pagamento.h - -check_PROGRAMS = listtest -listtest_SOURCES = listtest.c list.c list.h - -TESTS = $(check_PROGRAMS) +SUBDIRS = lib src test diff --git a/bootstrap.sh b/bootstrap.sh index 594643a..27e2764 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -33,4 +33,5 @@ test -e $CONFIG_FILE || touch $CONFIG_FILE aclocal autoheader autoconf +libtoolize --copy automake --add-missing --copy --force --foreign diff --git a/configure.ac b/configure.ac index 4b20a5f..2803970 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,8 @@ AC_INIT(declara,2015.0,libreceita@lists.libreplanetbr.org) AC_CONFIG_AUX_DIR(build-aux) AM_INIT_AUTOMAKE +LT_INIT AC_PROG_CC AC_PROG_INSTALL AC_CONFIG_HEADERS([config.h]) -AC_OUTPUT(Makefile) +AC_OUTPUT(Makefile lib/Makefile src/Makefile test/Makefile) diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..a8f050d --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,13 @@ +lib_LTLIBRARIES = libreceita.la +libreceita_la_SOURCES = declaracao.c declaracao.h \ + token.c token.h \ + cmd.c cmd.h pmhash.c pmhash.h \ + totais.c totais.h \ + calcula.c calcula.h \ + gera.c gera.h \ + base.c base.h \ + list.c list.h \ + util.c util.h \ + contribuinte.c contribuinte.h \ + rendimento.c rendimento.h \ + pagamento.c pagamento.h diff --git a/base.c b/lib/base.c similarity index 100% rename from base.c rename to lib/base.c diff --git a/base.h b/lib/base.h similarity index 100% rename from base.h rename to lib/base.h diff --git a/calcula.c b/lib/calcula.c similarity index 100% rename from calcula.c rename to lib/calcula.c diff --git a/calcula.h b/lib/calcula.h similarity index 100% rename from calcula.h rename to lib/calcula.h diff --git a/cmd.c b/lib/cmd.c similarity index 100% rename from cmd.c rename to lib/cmd.c diff --git a/cmd.h b/lib/cmd.h similarity index 100% rename from cmd.h rename to lib/cmd.h diff --git a/contribuinte.c b/lib/contribuinte.c similarity index 100% rename from contribuinte.c rename to lib/contribuinte.c diff --git a/contribuinte.h b/lib/contribuinte.h similarity index 100% rename from contribuinte.h rename to lib/contribuinte.h diff --git a/declaracao.c b/lib/declaracao.c similarity index 100% rename from declaracao.c rename to lib/declaracao.c diff --git a/declaracao.h b/lib/declaracao.h similarity index 100% rename from declaracao.h rename to lib/declaracao.h diff --git a/gera.c b/lib/gera.c similarity index 100% rename from gera.c rename to lib/gera.c diff --git a/gera.h b/lib/gera.h similarity index 100% rename from gera.h rename to lib/gera.h diff --git a/list.c b/lib/list.c similarity index 100% rename from list.c rename to lib/list.c diff --git a/list.h b/lib/list.h similarity index 100% rename from list.h rename to lib/list.h diff --git a/pagamento.c b/lib/pagamento.c similarity index 100% rename from pagamento.c rename to lib/pagamento.c diff --git a/pagamento.h b/lib/pagamento.h similarity index 100% rename from pagamento.h rename to lib/pagamento.h diff --git a/pmhash.c b/lib/pmhash.c similarity index 100% rename from pmhash.c rename to lib/pmhash.c diff --git a/pmhash.h b/lib/pmhash.h similarity index 100% rename from pmhash.h rename to lib/pmhash.h diff --git a/rendimento.c b/lib/rendimento.c similarity index 100% rename from rendimento.c rename to lib/rendimento.c diff --git a/rendimento.h b/lib/rendimento.h similarity index 100% rename from rendimento.h rename to lib/rendimento.h diff --git a/token.c b/lib/token.c similarity index 100% rename from token.c rename to lib/token.c diff --git a/token.h b/lib/token.h similarity index 100% rename from token.h rename to lib/token.h diff --git a/totais.c b/lib/totais.c similarity index 100% rename from totais.c rename to lib/totais.c diff --git a/totais.h b/lib/totais.h similarity index 100% rename from totais.h rename to lib/totais.h diff --git a/util.c b/lib/util.c similarity index 100% rename from util.c rename to lib/util.c diff --git a/util.h b/lib/util.h similarity index 100% rename from util.h rename to lib/util.h diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..3380b43 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,7 @@ +bin_PROGRAMS = declara + +declara_SOURCES = declara.c + +declara_CFLAGS = -I$(top_srcdir)/lib +declara_LDFLAGS = -static +declara_LDADD = -L$(top_builddir)/lib -lreceita diff --git a/declara.c b/src/declara.c similarity index 100% rename from declara.c rename to src/declara.c diff --git a/test/Makefile.am b/test/Makefile.am new file mode 100644 index 0000000..6cf16d1 --- /dev/null +++ b/test/Makefile.am @@ -0,0 +1,6 @@ +check_PROGRAMS = listtest +listtest_SOURCES = listtest.c +listtest_CFLAGS = -I$(top_srcdir)/lib +listtest_LDADD = -L$(top_builddir)/lib -lreceita + +TESTS = $(check_PROGRAMS) diff --git a/listtest.c b/test/listtest.c similarity index 100% rename from listtest.c rename to test/listtest.c -- 2.20.1