From f45d95b5214079cf3799a063bea47e49e82f71a3 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 23 Feb 2014 12:29:36 -0500 Subject: [PATCH] Move source files to src and include folder --- Makefile | 16 ++++++++-------- NEWS.adoc | 1 + compat/hashtab.c | 2 +- compat/mkstemps.c | 2 +- compat/setenv.c | 2 +- configure.ac | 2 +- git.h => include/git.h | 0 graph.h => include/graph.h | 0 io.h => include/io.h | 0 refs.h => include/refs.h | 0 tig.h => include/tig.h | 0 util.h => include/util.h | 0 graph.c => src/graph.c | 0 io.c => src/io.c | 0 refs.c => src/refs.c | 0 tig.c => src/tig.c | 0 util.c => src/util.c | 0 test/test-graph.c | 8 ++++---- 18 files changed, 17 insertions(+), 16 deletions(-) rename git.h => include/git.h (100%) rename graph.h => include/graph.h (100%) rename io.h => include/io.h (100%) rename refs.h => include/refs.h (100%) rename tig.h => include/tig.h (100%) rename util.h => include/util.h (100%) rename graph.c => src/graph.c (100%) rename io.c => src/io.c (100%) rename refs.c => src/refs.c (100%) rename tig.c => src/tig.c (100%) rename util.c => src/util.c (100%) diff --git a/Makefile b/Makefile index 2ae7946..cc844e0 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ RPM_RELEASE = $(word 2,$(RPM_VERLIST))$(if $(WTDIRTY),.dirty) LDLIBS ?= -lcurses CFLAGS ?= -Wall -O2 DFLAGS = -g -DDEBUG -Werror -O0 -EXE = tig +EXE = src/tig TOOLS = test/test-graph TXTDOC = doc/tig.1.adoc doc/tigrc.5.adoc doc/manual.adoc NEWS.adoc README.adoc INSTALL.adoc MANDOC = doc/tig.1 doc/tigrc.5 doc/tigmanual.7 @@ -118,7 +118,7 @@ install-release-doc: install-release-doc-man install-release-doc-html clean: $(RM) -r $(TARNAME) *.spec tig-*.tar.gz tig-*.tar.gz.md5 .deps - $(RM) $(EXE) $(TOOLS) $(OBJS) core doc/*.xml builtin-config.c + $(RM) $(EXE) $(TOOLS) $(OBJS) core doc/*.xml src/builtin-config.c distclean: clean $(RM) -r doc/manual.html-chunked autom4te.cache release-docs @@ -126,7 +126,7 @@ distclean: clean $(RM) config.h config.log config.make config.status config.h.in spell-check: - for file in $(TXTDOC) tig.c; do \ + for file in $(TXTDOC) src/tig.c; do \ aspell --lang=en --dont-backup \ --personal=./tools/aspell.dict check $$file; \ done @@ -184,10 +184,10 @@ COMPAT_OBJS += compat/hashtab.o override CPPFLAGS += $(COMPAT_CPPFLAGS) -TIG_OBJS = tig.o util.o io.o graph.o refs.o builtin-config.o $(COMPAT_OBJS) -tig: $(TIG_OBJS) +TIG_OBJS = src/tig.o src/util.o src/io.o src/graph.o src/refs.o src/builtin-config.o $(COMPAT_OBJS) +src/tig: $(TIG_OBJS) -TEST_GRAPH_OBJS = test/test-graph.o util.o io.o graph.o $(COMPAT_OBJS) +TEST_GRAPH_OBJS = test/test-graph.o src/util.o src/io.o src/graph.o $(COMPAT_OBJS) test/test-graph: $(TEST_GRAPH_OBJS) OBJS = $(sort $(TIG_OBJS) $(TEST_GRAPH_OBJS)) @@ -199,11 +199,11 @@ DEPS_CFLAGS ?= -MMD -MP -MF .deps/$*.d %.o: %.c @mkdir -p $(abspath .deps/$(*D)) - $(CC) $(CFLAGS) $(DEPS_CFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CC) -I. -Iinclude $(CFLAGS) $(DEPS_CFLAGS) $(CPPFLAGS) -c -o $@ $< -include $(OBJS:%.o=.deps/%.d) -builtin-config.c: tigrc tools/make-builtin-config.sh +src/builtin-config.c: tigrc tools/make-builtin-config.sh tools/make-builtin-config.sh $< > $@ tig.spec: contrib/tig.spec.in diff --git a/NEWS.adoc b/NEWS.adoc index 6e06795..27f62af 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -14,6 +14,7 @@ Note to packagers: included inside the binary as a fall-back. Pass `NO_BUILTIN_TIGRC=y` to not include the tigrc and reduce the size of the binary. - The example `contrib/tigrc` file (made obsolete by `tigrc`) has been removed. + - Source files was moved to `src` and `include`. Incompatibilities: diff --git a/compat/hashtab.c b/compat/hashtab.c index 65783ae..10d9b38 100644 --- a/compat/hashtab.c +++ b/compat/hashtab.c @@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA. */ the old table to the new table. */ #ifdef HAVE_CONFIG_H -#include "../config.h" +#include "config.h" #endif #include "compat.h" diff --git a/compat/mkstemps.c b/compat/mkstemps.c index c25e888..988ddd7 100644 --- a/compat/mkstemps.c +++ b/compat/mkstemps.c @@ -21,7 +21,7 @@ */ #ifdef HAVE_CONFIG_H -#include "../config.h" +#include "config.h" #endif #include "compat.h" diff --git a/compat/setenv.c b/compat/setenv.c index 46c2b10..f5b6543 100644 --- a/compat/setenv.c +++ b/compat/setenv.c @@ -39,7 +39,7 @@ environment. This implementation is not safe for multithreaded code. */ #ifdef HAVE_CONFIG_H -#include "../config.h" +#include "config.h" #endif #include "compat.h" diff --git a/configure.ac b/configure.ac index 4a3f5da..5cd8b42 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT([tig],[0],[Jonas Fonseca ],[tig]) AC_LANG([C]) AC_CONFIG_HEADER(config.h) -AC_CONFIG_SRCDIR(tig.c) +AC_CONFIG_SRCDIR(src) dnl Document where we keep our .m4 file. AC_CONFIG_MACRO_DIR([tools]) diff --git a/git.h b/include/git.h similarity index 100% rename from git.h rename to include/git.h diff --git a/graph.h b/include/graph.h similarity index 100% rename from graph.h rename to include/graph.h diff --git a/io.h b/include/io.h similarity index 100% rename from io.h rename to include/io.h diff --git a/refs.h b/include/refs.h similarity index 100% rename from refs.h rename to include/refs.h diff --git a/tig.h b/include/tig.h similarity index 100% rename from tig.h rename to include/tig.h diff --git a/util.h b/include/util.h similarity index 100% rename from util.h rename to include/util.h diff --git a/graph.c b/src/graph.c similarity index 100% rename from graph.c rename to src/graph.c diff --git a/io.c b/src/io.c similarity index 100% rename from io.c rename to src/io.c diff --git a/refs.c b/src/refs.c similarity index 100% rename from refs.c rename to src/refs.c diff --git a/tig.c b/src/tig.c similarity index 100% rename from tig.c rename to src/tig.c diff --git a/util.c b/src/util.c similarity index 100% rename from util.c rename to src/util.c diff --git a/test/test-graph.c b/test/test-graph.c index c35c82d..bd59a3d 100644 --- a/test/test-graph.c +++ b/test/test-graph.c @@ -11,10 +11,10 @@ * GNU General Public License for more details. */ -#include "../tig.h" -#include "../util.h" -#include "../io.h" -#include "../graph.h" +#include "tig.h" +#include "util.h" +#include "io.h" +#include "graph.h" #define USAGE \ "test-graph [--ascii]\n" \ -- 2.11.4.GIT