Makefile: Build exile.o separately, link it in all tests

This commit is contained in:
Albert S. 2022-03-14 22:30:53 +01:00
부모 70c3fef500
커밋 98421fab90
1개의 변경된 파일9개의 추가작업 그리고 5개의 파일을 삭제

파일 보기

@ -7,13 +7,17 @@ CXXFLAGS = -std=c++20 -Wall -Wextra -pedantic
clean:
rm -f test testcpp
rm -f test exile.o testcpp
test: test.c exile.h
$(CC) test.c exile.c -g $(CFLAGS) -o test
testcpp: test.cpp exile.h exile.hpp
$(CXX) test.cpp -g $(CXXFLAGS) -o testcpp
exile.o: exile.c exile.h
$(CC) -c exile.c -g $(CFLAGS) -o exile.o
test: test.c exile.h exile.o
$(CC) test.c exile.o -g $(CFLAGS) -o test
testcpp: test.cpp exile.h exile.hpp exile.o
$(CXX) test.cpp exile.o -g $(CXXFLAGS) -o testcpp
tests: test testcpp