From 3e29290164634f0c3dad7599df512e3890c67f2d Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 2 Aug 2012 16:36:29 -0700 Subject: [PATCH] Makefile: wire up test/ directory for compilation --- Makefile | 8 +++++++- test/Makefile | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/Makefile diff --git a/Makefile b/Makefile index 6a85ee8..c2d7072 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,9 @@ CPPFLAGS += -Iinclude -I. LDFLAGS=-ldl -lrt SHARED=-shared -all: $(LIB_SO) +TESTS=test + +all: $(LIB_SO) tests debug: CPPFLAGS += -DCONFIG_DEBUG debug: all @@ -42,9 +44,13 @@ snapshot.o: mymemory.h snapshot.h snapshotimp.h snapshot.cc clean: rm -f *.o *.so + $(MAKE) -C $(TESTS) clean mrclean: clean rm -rf docs tags:: ctags -R + +tests:: $(LIB_SO) + $(MAKE) -C $(TESTS) diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..f7a01be --- /dev/null +++ b/test/Makefile @@ -0,0 +1,15 @@ +include ../common.mk + +CPPFLAGS += -I.. -I../include +TESTS=userprog + +SRCS = $(wildcard *.c) +OBJS = $(patsubst %.c,%.o,$(SRCS)) + +all: $(OBJS) + +%.o: %.c + $(CC) -o $@ $< $(CPPFLAGS) -L.. -l$(LIB_NAME) + +clean:: + rm -f *.o $(TESTS) -- 2.34.1