forked from OpenGenus/cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
21 lines (17 loc) · 717 Bytes
/
makefile
File metadata and controls
21 lines (17 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#for C
CFLAGS = -Wall -Wextra -lm
C_SOURCES := $(shell find -name '*.c')
c: $(C_SOURCES)
$(CC) -o $@ $^ $(CFLAGS)
#for cpp
CXXFLAGS = -Wall
CPP_SOURCES := $(shell find -name '[^test_]*.cpp')
CPP_TEST_SOURCES := $(shell find -name 'test_*.cpp')
CATCH_MAIN_CONFIG_SOURCE = 'test/c++/catch_pch.cpp'
cpp:
@echo '---compiling source files---'
@$(foreach CPP_SOURCE,$(CPP_SOURCES),echo $(CXX) -c $(CXXFLAGS) $(CPP_SOURCE); \
$(CXX) -c $(CXXFLAGS) $(CPP_SOURCE);)
@echo '---compiling test files---'
@$(foreach CPP_TEST_SOURCE,$(CPP_TEST_SOURCES),echo $(CXX) $(CXXFLAGS) $(CATCH_MAIN_CONFIG_SOURCE) $(CPP_TEST_SOURCE); \
$(CXX) $(CXXFLAGS) $(CATCH_MAIN_CONFIG_SOURCE) $(CPP_TEST_SOURCE);)