Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
122-COM/makefile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 lines (24 sloc)
752 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC = g++ --std=c++11 | |
# where is cxxtestgen? | |
TESTGEN = cxxtestgen --error-printer | |
# things you want to test, each of these needs a matching file ending in _test.h | |
TESTS = pre_unit lab_stack lab_queue | |
#----------------------------------------- | |
# Shouldn't need to change anything below this bit | |
all: test | |
test: $(TESTS) | |
@(for i in $(TESTS); do echo "====== Run $$i tests ======"; ./$$i; echo ""; done) | |
TESTS_H = $(TESTS:=_test.h) | |
TESTS_CC = $(TESTS:=_test.cpp) | |
$(TESTS): $(TESTS_CC) | |
%_test.cpp: %_test.h | |
@(echo "====== Create the cxxtest code for $< ======") | |
$(TESTGEN) -o $@ $< | |
@(echo "") | |
%: %_test.cpp | |
@(echo "====== Compile the test runner for $< ======") | |
$(CC) -o $@ $< | |
@(echo "") | |
clean: | |
-rm -f *~ | |
-rm -f $(TESTS) $(TESTS_CC) |