Skip to content

Commit

Permalink
Enforce modular build
Browse files Browse the repository at this point in the history
  • Loading branch information
jserv committed Jan 22, 2020
1 parent 0f146d6 commit e3e9ee5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
handin.tar
qtest
*.o
*.o.d
*.dSYM
27 changes: 22 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@ CFLAGS = -O0 -g -Wall -Werror
GIT_HOOKS := .git/hooks/applied
all: $(GIT_HOOKS) qtest

# Control the build verbosity
ifeq ("$(VERBOSE)","1")
Q :=
VECHO = @true
else
Q := @
VECHO = @printf
endif

$(GIT_HOOKS):
@scripts/install-git-hooks
@echo

queue.o: queue.c queue.h harness.h
$(CC) $(CFLAGS) -c queue.c
OBJS := qtest.o report.o console.o harness.o queue.o
deps := $(OBJS:%.o=.%.o.d)

qtest: $(OBJS)
$(VECHO) " LD\t$@\n"
$(Q)$(CC) $(LDFLAGS) -o $@ $^

%.o: %.c
$(VECHO) " CC\t$@\n"
$(Q)$(CC) -o $@ $(CFLAGS) -c -MMD -MF .$@.d $<

qtest: qtest.c report.c console.c harness.c queue.o
$(CC) $(CFLAGS) -o qtest qtest.c report.c console.c harness.c queue.o

check: test
test: qtest scripts/driver.py
scripts/driver.py

Expand All @@ -31,7 +47,8 @@ valgrind: qtest valgrind_existence
@echo "scripts/driver.py -p $(patched_file) --valgrind -t <tid>"

clean:
rm -f *.o *~ qtest /tmp/qtest.*
rm -f $(OBJS) $(deps) *~ qtest /tmp/qtest.*
rm -rf *.dSYM
(cd traces; rm -f *~)

-include $(deps)

0 comments on commit e3e9ee5

Please sign in to comment.