mirror of
https://github.com/darlinghq/ctest.git
synced 2024-12-04 02:21:10 +00:00
Compile the example tests with both a C and C++ compiler
This commit is contained in:
parent
f8a83d694b
commit
78a37432bd
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
*.o
|
||||
tags
|
||||
test
|
||||
test++
|
||||
|
21
Makefile
21
Makefile
@ -2,17 +2,26 @@ UNAME=$(shell uname)
|
||||
|
||||
CCFLAGS=-Wall -Wextra -Wconversion -Wredundant-decls -Wshadow -Wno-unused-parameter -O3
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
|
||||
all: test
|
||||
all: test test++
|
||||
|
||||
remake: clean all
|
||||
|
||||
%.o: %.c ctest.h
|
||||
%.cpp: %.c
|
||||
ln -fs $< $@
|
||||
|
||||
%.c.o: %.c ctest.h
|
||||
$(CC) $(CCFLAGS) -c -o $@ $<
|
||||
|
||||
test: main.o ctest.h mytests.o
|
||||
$(CC) $(LDFLAGS) main.o mytests.o -o test
|
||||
%.cpp.o: %.cpp ctest.h
|
||||
$(CXX) $(CCFLAGS) -c -o $@ $<
|
||||
|
||||
test: main.c.o ctest.h mytests.c.o
|
||||
$(CC) $(LDFLAGS) main.c.o mytests.c.o -o test
|
||||
|
||||
test++: main.cpp.o ctest.h mytests.cpp.o
|
||||
$(CXX) $(LDFLAGS) main.cpp.o mytests.cpp.o -o test++
|
||||
|
||||
clean:
|
||||
rm -f test *.o
|
||||
|
||||
rm -f test test++ *.o
|
||||
|
Loading…
Reference in New Issue
Block a user