From 6fb817f218a69b28973b0d059d71809717b1e2d1 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 2 Apr 2017 16:17:33 -0700 Subject: [PATCH] lisp: Fix up lisp build so projects can get ao_lisp_const.h built as needed Signed-off-by: Keith Packard --- src/cortexelf-v1/Makefile | 6 ++++-- src/lisp/Makefile | 25 ++++--------------------- src/lisp/Makefile-inc | 22 ++++++++++++++++++++++ src/lisp/Makefile-lisp | 4 ++++ 4 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 src/lisp/Makefile-inc create mode 100644 src/lisp/Makefile-lisp diff --git a/src/cortexelf-v1/Makefile b/src/cortexelf-v1/Makefile index 66f18045..cea75ddf 100644 --- a/src/cortexelf-v1/Makefile +++ b/src/cortexelf-v1/Makefile @@ -102,7 +102,7 @@ HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_cortexelf.c OBJ=$(SRC:.c=.o) -all: $(PROG) $(HEX) +all:: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) cortexelf.ld $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) @@ -117,10 +117,12 @@ ao_product.h: ao-make-product.5c ../Version distclean: clean -clean: +clean:: rm -f *.o $(PROGNAME)-*.elf $(PROGNAME)-*.ihx rm -f ao_product.h +include ../lisp/Makefile-lisp + install: uninstall: diff --git a/src/lisp/Makefile b/src/lisp/Makefile index dd5a0cb4..25796ec5 100644 --- a/src/lisp/Makefile +++ b/src/lisp/Makefile @@ -6,32 +6,15 @@ clean: ao_lisp_const.h: ao_lisp_const.lisp ao_lisp_make_const ./ao_lisp_make_const -o $@ ao_lisp_const.lisp -SRCS=\ - ao_lisp_make_const.c\ - ao_lisp_mem.c \ - ao_lisp_cons.c \ - ao_lisp_string.c \ - ao_lisp_atom.c \ - ao_lisp_int.c \ - ao_lisp_poly.c \ - ao_lisp_builtin.c \ - ao_lisp_read.c \ - ao_lisp_frame.c \ - ao_lisp_lambda.c \ - ao_lisp_eval.c \ - ao_lisp_rep.c \ - ao_lisp_save.c \ - ao_lisp_stack.c \ - ao_lisp_error.c +include Makefile-inc +SRCS=$(LISP_SRCS) + +HDRS=$(LISP_HDRS) OBJS=$(SRCS:.c=.o) CFLAGS=-DAO_LISP_MAKE_CONST -O0 -g -I. -Wall -Wextra -no-pie -HDRS=\ - ao_lisp.h \ - ao_lisp_os.h \ - ao_lisp_read.h ao_lisp_make_const: $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) diff --git a/src/lisp/Makefile-inc b/src/lisp/Makefile-inc new file mode 100644 index 00000000..126deeb0 --- /dev/null +++ b/src/lisp/Makefile-inc @@ -0,0 +1,22 @@ +LISP_SRCS=\ + ao_lisp_make_const.c\ + ao_lisp_mem.c \ + ao_lisp_cons.c \ + ao_lisp_string.c \ + ao_lisp_atom.c \ + ao_lisp_int.c \ + ao_lisp_poly.c \ + ao_lisp_builtin.c \ + ao_lisp_read.c \ + ao_lisp_frame.c \ + ao_lisp_lambda.c \ + ao_lisp_eval.c \ + ao_lisp_rep.c \ + ao_lisp_save.c \ + ao_lisp_stack.c \ + ao_lisp_error.c + +LISP_HDRS=\ + ao_lisp.h \ + ao_lisp_os.h \ + ao_lisp_read.h diff --git a/src/lisp/Makefile-lisp b/src/lisp/Makefile-lisp new file mode 100644 index 00000000..998c7673 --- /dev/null +++ b/src/lisp/Makefile-lisp @@ -0,0 +1,4 @@ +include ../lisp/Makefile-inc + +ao_lisp_const.h: $(LISP_SRCS) $(LISP_HDRS) + +cd ../lisp && make $@ -- 2.30.2