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