-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmakefile
More file actions
28 lines (21 loc) · 694 Bytes
/
makefile
File metadata and controls
28 lines (21 loc) · 694 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
CFLAGS = -Wall -fsanitize=address -fno-omit-frame-pointer
LDFLAGS =
PROG = chell
CXX = gcc
FILES = chell.c chad-readline.c chad-history.c commands.c
SOURCE_FILES = $(foreach file, $(FILES), src/$(file))
HFILES = defs.h chad-history.h chad-readline.h chell.h commands.h
HEADER_FILES = $(foreach file, $(HFILES), src/$(file))
# top-level rule to create the program.
all: $(PROG)
# compile chell
$(PROG): $(SOURCE_FILES) $(HEADER_FILES)
$(CXX) $(CFLAGS) $(SOURCE_FILES) -o $(PROG) $(LDFLAGS)
# cleaning everything that can be automatically recreated with "make"
clean:
rm $(PROG)
run:
@echo ----- building $(PROG) -----
@make all
@echo ----- running $(PROG) -----
@./$(PROG)