From d7b662ac902cd37ecb513766a31b002e6d408b2a Mon Sep 17 00:00:00 2001 From: Mike Lowis Date: Fri, 7 Oct 2016 13:00:12 -0400 Subject: [PATCH] Tweaked makefile and test files to ensure the tests rebuild on updates to tested files --- Makefile | 10 ++++------ tests/buf.c | 2 +- tests/tests.c | 4 ++++ tests/utf8.c | 1 - 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b6d9998..396b07b 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,17 @@ LDFLAGS = -L/opt/X11/lib -lX11 -lXft CFLAGS = --std=c99 -Wall -Wextra -I. -I/opt/X11/include -I/opt/local/include/freetype2 -I/usr/include/freetype2 -SRCS = xedit.c buf.c screen.c utf8.c keyboard.c mouse.c -OBJS = $(SRCS:.c=.o) -TESTSRCS = tests/tests.c tests/buf.c tests/utf8.c -TESTOBJS = $(TESTSRCS:.c=.o) +OBJS = buf.o screen.o utf8.o keyboard.o mouse.o +TESTOBJS = tests/tests.o tests/buf.o tests/utf8.o all: edit test test: unittests ./unittests -edit: $(OBJS) +edit: xedit.o $(OBJS) $(CC) -o $@ $^ $(LDFLAGS) -unittests: $(TESTOBJS) +unittests: $(TESTOBJS) $(OBJS) $(CC) -o $@ $^ $(LDFLAGS) clean: diff --git a/tests/buf.c b/tests/buf.c index e9e449c..fac28c2 100644 --- a/tests/buf.c +++ b/tests/buf.c @@ -1,5 +1,5 @@ #include "atf.h" -#include "../buf.c" +#include "edit.h" static Buf TestBuf; diff --git a/tests/tests.c b/tests/tests.c index 051ab35..0f066e9 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -1,5 +1,9 @@ #define INCLUDE_DEFS #include "atf.h" +#include "edit.h" + +Buf Buffer; +unsigned CursorPos; int main(int argc, char** argv) { atf_init(argc,argv); diff --git a/tests/utf8.c b/tests/utf8.c index 7f969e1..006954e 100644 --- a/tests/utf8.c +++ b/tests/utf8.c @@ -1,5 +1,4 @@ #include "atf.h" -#include "../utf8.c" TEST_SUITE(Utf8Tests) { } -- 2.49.0