aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-03-22 20:11:11 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-03-22 20:17:52 +0100
commitd46183860c1f3f10095e95023adcb79b1896ab0e (patch)
treedd331a0efe9777bfe84160139da1e39df3226b71
parentAdd stuff to test.scm. (diff)
downloadcalp-d46183860c1f3f10095e95023adcb79b1896ab0e.tar.gz
calp-d46183860c1f3f10095e95023adcb79b1896ab0e.tar.xz
Move C and Scheme code into subdirs.
-rw-r--r--Makefile32
-rw-r--r--module/config.scm (renamed from config.scm)0
-rw-r--r--module/exceptions.scm (renamed from exceptions.scm)0
-rwxr-xr-xmodule/fetch.scm (renamed from fetch.scm)0
-rw-r--r--module/helpers.scm (renamed from helpers.scm)0
-rwxr-xr-xmodule/main.scm (renamed from main.scm)0
-rw-r--r--module/srfi/srfi-19/setters.scm (renamed from srfi/srfi-19/setters.scm)0
-rw-r--r--module/srfi/srfi-19/util.scm (renamed from srfi/srfi-19/util.scm)0
-rw-r--r--module/srfi/srfi-41/util.scm (renamed from srfi/srfi-41/util.scm)0
-rw-r--r--module/terminal/escape.scm (renamed from terminal/escape.scm)0
-rw-r--r--module/terminal/termios.scm (renamed from terminal/termios.scm)4
-rw-r--r--module/terminal/util.scm (renamed from terminal/util.scm)0
-rwxr-xr-xmodule/test.scm (renamed from test.scm)2
-rw-r--r--module/util.scm (renamed from util.scm)0
-rw-r--r--module/vcalendar.scm (renamed from vcalendar.scm)0
-rw-r--r--module/vcalendar/control.scm (renamed from vcalendar/control.scm)0
-rw-r--r--module/vcalendar/datetime.scm (renamed from vcalendar/datetime.scm)0
-rw-r--r--module/vcalendar/output.scm (renamed from vcalendar/output.scm)0
-rw-r--r--module/vcalendar/primitive.scm (renamed from vcalendar/primitive.scm)4
-rw-r--r--module/vcalendar/recur.scm (renamed from vcalendar/recur.scm)0
-rw-r--r--module/vcalendar/recurrence/generate.scm (renamed from vcalendar/recurrence/generate.scm)0
-rw-r--r--module/vcalendar/recurrence/internal.scm (renamed from vcalendar/recurrence/internal.scm)0
-rw-r--r--module/vcalendar/recurrence/parse.scm (renamed from vcalendar/recurrence/parse.scm)0
-rw-r--r--src/calendar.c (renamed from calendar.c)0
-rw-r--r--src/calendar.h (renamed from calendar.h)0
-rw-r--r--src/err.h (renamed from err.h)0
-rw-r--r--src/graphs.c (renamed from graphs.c)0
-rw-r--r--src/graphs.h (renamed from graphs.h)0
-rw-r--r--src/guile_interface.h (renamed from guile_interface.h)0
-rw-r--r--src/guile_interface.scm.c (renamed from guile_interface.scm.c)0
-rw-r--r--src/guile_type_helpers.c (renamed from guile_type_helpers.c)0
-rw-r--r--src/guile_type_helpers.h (renamed from guile_type_helpers.h)0
-rw-r--r--src/linked_list.h (renamed from linked_list.h)0
-rw-r--r--src/linked_list.inc.h (renamed from linked_list.inc.h)0
-rw-r--r--src/macro.h (renamed from macro.h)0
-rw-r--r--src/main.c (renamed from main.c)0
-rw-r--r--src/pair.h (renamed from pair.h)0
-rw-r--r--src/pair.inc.h (renamed from pair.inc.h)0
-rw-r--r--src/parse.c (renamed from parse.c)0
-rw-r--r--src/parse.h (renamed from parse.h)0
-rw-r--r--src/strbuf.c (renamed from strbuf.c)0
-rw-r--r--src/strbuf.h (renamed from strbuf.h)0
-rw-r--r--src/termios.scm.c (renamed from termios.scm.c)0
-rw-r--r--src/trie.h (renamed from trie.h)0
-rw-r--r--src/trie.inc.h (renamed from trie.inc.h)0
-rw-r--r--src/vcal.c (renamed from vcal.c)0
-rw-r--r--src/vcal.h (renamed from vcal.h)0
47 files changed, 28 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 59c611df..e0dbd87c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,42 +3,52 @@
CC := gcc
OBJDIR = obj
+SRCDIR = src
+LIBDIR = lib
CFLAGS = -std=gnu11 -Wall -Wextra \
-ggdb -fPIC \
$(shell guile-config compile)
LDFLAGS = -fPIC $(shell guile-config link)
-H_FILES = $(wildcard *.h)
-C_FILES = $(wildcard *.c)
+LIBS = libguile-calendar.so libtermios.so
+SO_FILES = $(addprefix $(LIBDIR)/, $(LIBS))
-SCM_C_FILES = $(wildcard *.scm.c)
+H_FILES = $(wildcard src/*.h)
+C_FILES = $(wildcard src/*.c)
+
+SCM_C_FILES = $(wildcard src/*.scm.c)
X_FILES = $(SCM_C_FILES:.scm.c=.x)
.SECONDARY: $(X_FILES)
-O_FILES = $(C_FILES:%.c=obj/%.o)
+O_FILES = $(C_FILES:src/%.c=obj/%.o)
-all: parse libguile-calendar.so libtermios.so
+all: parse $(SO_FILES)
parse: $(O_FILES)
$(CC) -o $@ $^ $(LDFLAGS)
$(O_FILES): | $(OBJDIR)
-%.x : %.scm.c
+$(SO_FILES): | $(LIBDIR)
+
+src/%.x : src/%.scm.c
guile-snarf -o $@ $< $(CFLAGS)
-$(OBJDIR)/%.scm.o : %.scm.c %.x
+$(OBJDIR)/%.scm.o : src/%.scm.c src/%.x
$(CC) -c $(CFLAGS) -o $@ $<
-$(OBJDIR)/%.o : %.c # $(H_FILES) $(X_FILES)
+$(OBJDIR)/%.o : src/%.c # $(H_FILES) $(X_FILES)
$(CC) -c $(CFLAGS) -o $@ $<
$(OBJDIR):
mkdir -p $(OBJDIR)
-%.so: $(O_FILES)
+$(LIBDIR):
+ mkdir -p $(LIBDIR)
+
+$(LIBDIR)/%.so: $(O_FILES)
$(CC) -shared -o $@ $^ $(LDFLAGS)
.SECONDARY += %.dot
@@ -56,8 +66,8 @@ clean:
-rm parse
-rm $(OBJDIR)/*.o
-rmdir $(OBJDIR)
- -rm *.so
- -rm *.x
+ -rm $(LIBDIR)/*.so
+ -rm $(SRCDIR)/*.x
clean-scheme:
rm -r $$HOME/.cache/guile/ccache/2.2-LE-8-3.A/$$PWD
diff --git a/config.scm b/module/config.scm
index 3c6ebbb0..3c6ebbb0 100644
--- a/config.scm
+++ b/module/config.scm
diff --git a/exceptions.scm b/module/exceptions.scm
index 027c75ee..027c75ee 100644
--- a/exceptions.scm
+++ b/module/exceptions.scm
diff --git a/fetch.scm b/module/fetch.scm
index a91e4d0d..a91e4d0d 100755
--- a/fetch.scm
+++ b/module/fetch.scm
diff --git a/helpers.scm b/module/helpers.scm
index 717a10d4..717a10d4 100644
--- a/helpers.scm
+++ b/module/helpers.scm
diff --git a/main.scm b/module/main.scm
index 223b3d2e..223b3d2e 100755
--- a/main.scm
+++ b/module/main.scm
diff --git a/srfi/srfi-19/setters.scm b/module/srfi/srfi-19/setters.scm
index 45876382..45876382 100644
--- a/srfi/srfi-19/setters.scm
+++ b/module/srfi/srfi-19/setters.scm
diff --git a/srfi/srfi-19/util.scm b/module/srfi/srfi-19/util.scm
index a4b704b0..a4b704b0 100644
--- a/srfi/srfi-19/util.scm
+++ b/module/srfi/srfi-19/util.scm
diff --git a/srfi/srfi-41/util.scm b/module/srfi/srfi-41/util.scm
index 5bef95cb..5bef95cb 100644
--- a/srfi/srfi-41/util.scm
+++ b/module/srfi/srfi-41/util.scm
diff --git a/terminal/escape.scm b/module/terminal/escape.scm
index 8f1b0c2b..8f1b0c2b 100644
--- a/terminal/escape.scm
+++ b/module/terminal/escape.scm
diff --git a/terminal/termios.scm b/module/terminal/termios.scm
index b0ae585e..50683f84 100644
--- a/terminal/termios.scm
+++ b/module/terminal/termios.scm
@@ -7,5 +7,7 @@
(define-public ECHO #x0000010)
(define-public ICANON #x0000002)
-(setenv "LD_LIBRARY_PATH" (dirname (dirname (current-filename))))
+(setenv "LD_LIBRARY_PATH"
+ (string-append (dirname (dirname (dirname (current-filename))))
+ "/lib"))
(load-extension "libtermios" "init_termios")
diff --git a/terminal/util.scm b/module/terminal/util.scm
index a7435ad8..a7435ad8 100644
--- a/terminal/util.scm
+++ b/module/terminal/util.scm
diff --git a/test.scm b/module/test.scm
index 1b3c539e..10c6c1a1 100755
--- a/test.scm
+++ b/module/test.scm
@@ -12,7 +12,7 @@
(vcalendar output)
(vcalendar recur))
-(define cal (make-vcomponent "testcal/repeating-event.ics"))
+(define cal (make-vcomponent "../testcal/repeating-event.ics"))
(define ev (car (children cal 'VEVENT)))
diff --git a/util.scm b/module/util.scm
index 6f1b955a..6f1b955a 100644
--- a/util.scm
+++ b/module/util.scm
diff --git a/vcalendar.scm b/module/vcalendar.scm
index 3f7ba6ba..3f7ba6ba 100644
--- a/vcalendar.scm
+++ b/module/vcalendar.scm
diff --git a/vcalendar/control.scm b/module/vcalendar/control.scm
index a38d678f..a38d678f 100644
--- a/vcalendar/control.scm
+++ b/module/vcalendar/control.scm
diff --git a/vcalendar/datetime.scm b/module/vcalendar/datetime.scm
index 360b8348..360b8348 100644
--- a/vcalendar/datetime.scm
+++ b/module/vcalendar/datetime.scm
diff --git a/vcalendar/output.scm b/module/vcalendar/output.scm
index e4635beb..e4635beb 100644
--- a/vcalendar/output.scm
+++ b/module/vcalendar/output.scm
diff --git a/vcalendar/primitive.scm b/module/vcalendar/primitive.scm
index fdce550c..b5eb9388 100644
--- a/vcalendar/primitive.scm
+++ b/module/vcalendar/primitive.scm
@@ -17,5 +17,7 @@
%vcomponent-shallow-copy))
-(setenv "LD_LIBRARY_PATH" (dirname (dirname (current-filename))))
+(setenv "LD_LIBRARY_PATH"
+ (string-append (dirname (dirname (dirname (current-filename))))
+ "/lib"))
(load-extension "libguile-calendar" "init_lib")
diff --git a/vcalendar/recur.scm b/module/vcalendar/recur.scm
index 3657cae6..3657cae6 100644
--- a/vcalendar/recur.scm
+++ b/module/vcalendar/recur.scm
diff --git a/vcalendar/recurrence/generate.scm b/module/vcalendar/recurrence/generate.scm
index fae404ec..fae404ec 100644
--- a/vcalendar/recurrence/generate.scm
+++ b/module/vcalendar/recurrence/generate.scm
diff --git a/vcalendar/recurrence/internal.scm b/module/vcalendar/recurrence/internal.scm
index b62d75c2..b62d75c2 100644
--- a/vcalendar/recurrence/internal.scm
+++ b/module/vcalendar/recurrence/internal.scm
diff --git a/vcalendar/recurrence/parse.scm b/module/vcalendar/recurrence/parse.scm
index abead3a9..abead3a9 100644
--- a/vcalendar/recurrence/parse.scm
+++ b/module/vcalendar/recurrence/parse.scm
diff --git a/calendar.c b/src/calendar.c
index edc1151e..edc1151e 100644
--- a/calendar.c
+++ b/src/calendar.c
diff --git a/calendar.h b/src/calendar.h
index 20b78a9f..20b78a9f 100644
--- a/calendar.h
+++ b/src/calendar.h
diff --git a/err.h b/src/err.h
index d9d19ec7..d9d19ec7 100644
--- a/err.h
+++ b/src/err.h
diff --git a/graphs.c b/src/graphs.c
index 51a26117..51a26117 100644
--- a/graphs.c
+++ b/src/graphs.c
diff --git a/graphs.h b/src/graphs.h
index fe521003..fe521003 100644
--- a/graphs.h
+++ b/src/graphs.h
diff --git a/guile_interface.h b/src/guile_interface.h
index 76ec24d3..76ec24d3 100644
--- a/guile_interface.h
+++ b/src/guile_interface.h
diff --git a/guile_interface.scm.c b/src/guile_interface.scm.c
index 3d0bff1e..3d0bff1e 100644
--- a/guile_interface.scm.c
+++ b/src/guile_interface.scm.c
diff --git a/guile_type_helpers.c b/src/guile_type_helpers.c
index e231f2b1..e231f2b1 100644
--- a/guile_type_helpers.c
+++ b/src/guile_type_helpers.c
diff --git a/guile_type_helpers.h b/src/guile_type_helpers.h
index 2ff177e1..2ff177e1 100644
--- a/guile_type_helpers.h
+++ b/src/guile_type_helpers.h
diff --git a/linked_list.h b/src/linked_list.h
index ec1e17e0..ec1e17e0 100644
--- a/linked_list.h
+++ b/src/linked_list.h
diff --git a/linked_list.inc.h b/src/linked_list.inc.h
index 81974a9c..81974a9c 100644
--- a/linked_list.inc.h
+++ b/src/linked_list.inc.h
diff --git a/macro.h b/src/macro.h
index 7b620f83..7b620f83 100644
--- a/macro.h
+++ b/src/macro.h
diff --git a/main.c b/src/main.c
index 791bc5d3..791bc5d3 100644
--- a/main.c
+++ b/src/main.c
diff --git a/pair.h b/src/pair.h
index e96cf180..e96cf180 100644
--- a/pair.h
+++ b/src/pair.h
diff --git a/pair.inc.h b/src/pair.inc.h
index c42b2dfd..c42b2dfd 100644
--- a/pair.inc.h
+++ b/src/pair.inc.h
diff --git a/parse.c b/src/parse.c
index 0e37350d..0e37350d 100644
--- a/parse.c
+++ b/src/parse.c
diff --git a/parse.h b/src/parse.h
index 53263b4c..53263b4c 100644
--- a/parse.h
+++ b/src/parse.h
diff --git a/strbuf.c b/src/strbuf.c
index 0e56468b..0e56468b 100644
--- a/strbuf.c
+++ b/src/strbuf.c
diff --git a/strbuf.h b/src/strbuf.h
index 7f936a9e..7f936a9e 100644
--- a/strbuf.h
+++ b/src/strbuf.h
diff --git a/termios.scm.c b/src/termios.scm.c
index 939c3574..939c3574 100644
--- a/termios.scm.c
+++ b/src/termios.scm.c
diff --git a/trie.h b/src/trie.h
index 9de38be3..9de38be3 100644
--- a/trie.h
+++ b/src/trie.h
diff --git a/trie.inc.h b/src/trie.inc.h
index ffc8ac8e..ffc8ac8e 100644
--- a/trie.inc.h
+++ b/src/trie.inc.h
diff --git a/vcal.c b/src/vcal.c
index 305275e7..305275e7 100644
--- a/vcal.c
+++ b/src/vcal.c
diff --git a/vcal.h b/src/vcal.h
index 1dfc5b17..1dfc5b17 100644
--- a/vcal.h
+++ b/src/vcal.h