Skip to content

Commit f70b61e

Browse files
committed
restructure
1 parent c6faef4 commit f70b61e

File tree

10 files changed

+298
-201
lines changed

10 files changed

+298
-201
lines changed

.DS_Store

6 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

makefile

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
1-
CC=clang
2-
CFLAGS=-lncurses -Ofast
1+
# if you type 'make' without arguments, this is the default
2+
PROG = tterm
3+
all: $(PROG)
34

4-
BIN=typingterm
5+
# Tell make about the file dependencies
6+
HEAD = strlist.h frame.h
7+
OBJ = strlist.o frame.o strlist_test.o typingtest.o
58

6-
all: clean $(BIN)
9+
# special libraries This can be blank
10+
LIB = -lncurses
711

8-
typingterm: src/typingtest.c src/frame.o src/strlist.o
9-
$(CC) $^ -o $@ $(CFLAGS)
12+
# select the compiler and flags
13+
# you can over-ride these on the command line e.g. make DEBUG=
14+
CC = clang
15+
DEBUG = -g -fsanitize=address
16+
CSTD =
17+
WARN = -Wall -Wextra -Werror
18+
CDEFS =
19+
CFLAGS = -I. $(DEBUG) $(WARN) $(CSTD) $(CDEFS)
20+
21+
$(OBJ): $(HEAD)
22+
23+
# specify how to compile the target
24+
$(PROG): $(OBJ)
25+
$(CC) $(CFLAGS) $(OBJ) $(LIB) -o $@
1026

11-
.PHONY: clean
27+
28+
.PHONY: clean test_strlist install
1229

1330
clean:
14-
rm -f *.o $(BIN)
31+
rm -f $(OBJ) $(BIN)
1532

16-
install: typingterm
33+
install: $(PROG)
1734
echo "Linking binaries\n"
1835
rm -f /usr/local/bin/typingterm
1936
ln ./typingterm /usr/local/bin/typingterm
2037
rm -f /usr/local/bin/tterm
2138
ln ./typingterm /usr/local/bin/tterm
39+
40+
strlist_test: $(OBJ)
41+
$(CC) $^ -o $@ $(CFLAGS)

src/strlist.c

Lines changed: 0 additions & 132 deletions
This file was deleted.

src/strlist.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/test.c

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)