From 65015374fa4860d155587e0af448e209b5d2e608 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 20 Apr 2011 20:42:58 -0700 Subject: [PATCH] organize project a little --- Makefile | 18 +++--------------- stdlib.scm => lib/stdlib.scm | 0 src/Makefile | 15 +++++++++++++++ bool.c => src/bool.c | 0 bool.h => src/bool.h | 0 comment.c => src/comment.c | 0 comment.h => src/comment.h | 0 dlist.c => src/dlist.c | 0 dlist.h => src/dlist.h | 0 env.c => src/env.c | 0 env.h => src/env.h | 0 eval.c => src/eval.c | 0 eval.h => src/eval.h | 0 fn.c => src/fn.c | 0 fn.h => src/fn.h | 0 int.c => src/int.c | 0 int.h => src/int.h | 0 lake.c => src/lake.c | 0 lake.h => src/lake.h | 0 list.c => src/list.c | 0 list.h => src/list.h | 0 parse.c => src/parse.c | 0 parse.h => src/parse.h | 0 primitive.c => src/primitive.c | 1 - primitive.h => src/primitive.h | 0 string.c => src/string.c | 0 string.h => src/string.h | 0 sym.c => src/sym.c | 0 sym.h => src/sym.h | 0 symtable.c => src/symtable.c | 0 symtable.h => src/symtable.h | 0 31 files changed, 18 insertions(+), 16 deletions(-) rename stdlib.scm => lib/stdlib.scm (100%) create mode 100644 src/Makefile rename bool.c => src/bool.c (100%) rename bool.h => src/bool.h (100%) rename comment.c => src/comment.c (100%) rename comment.h => src/comment.h (100%) rename dlist.c => src/dlist.c (100%) rename dlist.h => src/dlist.h (100%) rename env.c => src/env.c (100%) rename env.h => src/env.h (100%) rename eval.c => src/eval.c (100%) rename eval.h => src/eval.h (100%) rename fn.c => src/fn.c (100%) rename fn.h => src/fn.h (100%) rename int.c => src/int.c (100%) rename int.h => src/int.h (100%) rename lake.c => src/lake.c (100%) rename lake.h => src/lake.h (100%) rename list.c => src/list.c (100%) rename list.h => src/list.h (100%) rename parse.c => src/parse.c (100%) rename parse.h => src/parse.h (100%) rename primitive.c => src/primitive.c (99%) rename primitive.h => src/primitive.h (100%) rename string.c => src/string.c (100%) rename string.h => src/string.h (100%) rename sym.c => src/sym.c (100%) rename sym.h => src/sym.h (100%) rename symtable.c => src/symtable.c (100%) rename symtable.h => src/symtable.h (100%) diff --git a/Makefile b/Makefile index 36accb3..412e565 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,3 @@ -CC = gcc -CFLAGS := -Wall -g $(shell pkg-config --cflags glib-2.0) -LFLAGS := $(shell pkg-config --libs glib-2.0) -OBJS = lake.o env.o int.o string.o sym.o parse.o bool.o list.o eval.o \ - symtable.o fn.o dlist.o primitive.o comment.o - -all: lake - -lake: $(OBJS) - $(CC) $(CFLAGS) $(LFLAGS) $^ -o $@ - -# use touch to prevent errors in case files do not exist -clean: - @touch dummy.o lake - rm -f *.o lake +all: + cd src && make clean && make + mv src/lake ./lake diff --git a/stdlib.scm b/lib/stdlib.scm similarity index 100% rename from stdlib.scm rename to lib/stdlib.scm diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..36accb3 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,15 @@ +CC = gcc +CFLAGS := -Wall -g $(shell pkg-config --cflags glib-2.0) +LFLAGS := $(shell pkg-config --libs glib-2.0) +OBJS = lake.o env.o int.o string.o sym.o parse.o bool.o list.o eval.o \ + symtable.o fn.o dlist.o primitive.o comment.o + +all: lake + +lake: $(OBJS) + $(CC) $(CFLAGS) $(LFLAGS) $^ -o $@ + +# use touch to prevent errors in case files do not exist +clean: + @touch dummy.o lake + rm -f *.o lake diff --git a/bool.c b/src/bool.c similarity index 100% rename from bool.c rename to src/bool.c diff --git a/bool.h b/src/bool.h similarity index 100% rename from bool.h rename to src/bool.h diff --git a/comment.c b/src/comment.c similarity index 100% rename from comment.c rename to src/comment.c diff --git a/comment.h b/src/comment.h similarity index 100% rename from comment.h rename to src/comment.h diff --git a/dlist.c b/src/dlist.c similarity index 100% rename from dlist.c rename to src/dlist.c diff --git a/dlist.h b/src/dlist.h similarity index 100% rename from dlist.h rename to src/dlist.h diff --git a/env.c b/src/env.c similarity index 100% rename from env.c rename to src/env.c diff --git a/env.h b/src/env.h similarity index 100% rename from env.h rename to src/env.h diff --git a/eval.c b/src/eval.c similarity index 100% rename from eval.c rename to src/eval.c diff --git a/eval.h b/src/eval.h similarity index 100% rename from eval.h rename to src/eval.h diff --git a/fn.c b/src/fn.c similarity index 100% rename from fn.c rename to src/fn.c diff --git a/fn.h b/src/fn.h similarity index 100% rename from fn.h rename to src/fn.h diff --git a/int.c b/src/int.c similarity index 100% rename from int.c rename to src/int.c diff --git a/int.h b/src/int.h similarity index 100% rename from int.h rename to src/int.h diff --git a/lake.c b/src/lake.c similarity index 100% rename from lake.c rename to src/lake.c diff --git a/lake.h b/src/lake.h similarity index 100% rename from lake.h rename to src/lake.h diff --git a/list.c b/src/list.c similarity index 100% rename from list.c rename to src/list.c diff --git a/list.h b/src/list.h similarity index 100% rename from list.h rename to src/list.h diff --git a/parse.c b/src/parse.c similarity index 100% rename from parse.c rename to src/parse.c diff --git a/parse.h b/src/parse.h similarity index 100% rename from parse.h rename to src/parse.h diff --git a/primitive.c b/src/primitive.c similarity index 99% rename from primitive.c rename to src/primitive.c index cdba491..6af7d8f 100644 --- a/primitive.c +++ b/src/primitive.c @@ -63,7 +63,6 @@ static LakeVal *prim_not(LakeList *args) } \ } while (0) - static LakeVal *prim_add(LakeList *args) { int result = 0; diff --git a/primitive.h b/src/primitive.h similarity index 100% rename from primitive.h rename to src/primitive.h diff --git a/string.c b/src/string.c similarity index 100% rename from string.c rename to src/string.c diff --git a/string.h b/src/string.h similarity index 100% rename from string.h rename to src/string.h diff --git a/sym.c b/src/sym.c similarity index 100% rename from sym.c rename to src/sym.c diff --git a/sym.h b/src/sym.h similarity index 100% rename from sym.h rename to src/sym.h diff --git a/symtable.c b/src/symtable.c similarity index 100% rename from symtable.c rename to src/symtable.c diff --git a/symtable.h b/src/symtable.h similarity index 100% rename from symtable.h rename to src/symtable.h