-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (25 loc) · 744 Bytes
/
Makefile
File metadata and controls
35 lines (25 loc) · 744 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
26
27
28
29
30
31
32
33
34
35
# Requires: libreadline8, libreadline-dev, libncurses-dev
# sudo apt-get install libreadline8 libreadline-dev libncurses-dev
CC ?= gcc
CFLAGS ?= -std=c17 -g\
-D_POSIX_SOURCE -D_DEFAULT_SOURCE\
-Wall -Werror -pedantic
.SUFFIXES: .c .o
.PHONY: all clean re
LIBS := -lreadline -lncurses
SRCS_DIR := ./src
SRCS := $(wildcard $(SRCS_DIR)/*.c)
OBJS := $(SRCS:.c=.o)
TESTDIR := tester/tests
TESTS := $(shell find $(TESTDIR) -type f -exec basename {} \;)
all: icshell
icshell: $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
test: clean_test icshell
cd tester && python3 test.py
clean_test:
$(RM) -r $(addprefix tester/, $(TESTS)) tester/files_backup \
tester/files/outfile
clean: clean_test
$(RM) $(SRCS_DIR)/*.o icshell
re: clean all