forked from jafffy/mysh-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (20 loc) · 715 Bytes
/
Makefile
File metadata and controls
25 lines (20 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# For implementation
CC=gcc -std=c99
CFLAGS=-I./src -I./include
LIB=-lpthread
OBJ=./src/utils.o ./src/commands.o ./src/built_in.o ./src/signal_handlers.o
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
mysh: $(OBJ)
$(CC) -o $@ $^ ./src/main.c $(CFLAGS) $(LIB)
# For testing
CXX=g++ -std=c++11
TESTING_FLAGS=-I./tests/src -I./tests/include $(CFLAGS) -Wno-write-strings
TESTING_LIB=-lgtest -lgtest_main -L./tests/lib -lpthread $(LIB)
TESTING_SRC=./tests/src/command_parsing_test.cc ./tests/src/command_validate_test.cc
TESTING_EXE=mysh-test
test: $(OBJ)
$(CXX) $(TESTING_FLAGS) -o $(TESTING_EXE) $(TESTING_SRC) $(OBJ) $(TESTING_LIB) $(LIB)
./$(TESTING_EXE)
clean:
rm -f $(TESTING_EXE) $(OBJ) mysh ./src/main.o