summaryrefslogtreecommitdiff
path: root/Makefile
blob: e7097764ec21d07db3a5c553cf8998a66dffc06d (plain)
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
CC=gcc
CFLAGS=-Wfatal-errors -Wall -Werror -Wextra -g -O2 -static
CFLAGS_TESTBIN=-Wfatal-errors -Wall -Werror -Wextra -g -fsanitize=address
CFLAGS_RELEASE=-O2 -flto -march=native -DNDEBUG -fomit-frame-pointer -s -static
TARGET=7ed
TESTTARGET=7ed-TESTING
INSTALL_DIRECTORY=/usr/local/bin
MAKEFLAGS += -s

all: 7ed
7ed:
	echo "CC 7ed.c functions.c startmode.c editmode.c ---> $(TARGET)"
	$(CC) $(CFLAGS) 7ed.c functions.c startmode.c editmode.c -o $(TARGET)
	echo "$(TARGET) is done. Run 'make install' as root to install it"
	
clean:
	echo "rm -f $(TARGET)"
	rm -f $(TARGET)
	echo "rm -f test/$(TESTTARGET)"
	rm -f test/$(TESTTARGET)

tests:
	echo "CC 7ed.c functions.c startmode.c editmode.c ---> test/$(TESTTARGET)"
	$(CC) $(CFLAGS_TESTBIN) 7ed.c functions.c startmode.c editmode.c -o test/$(TESTTARGET)

install:
	cp $(TARGET) $(INSTALL_DIRECTORY)
	echo "$(TARGET) was installed to $(INSTALL_DIRECTORY)"

release:
	echo "CC 7ed.c functions.c startmode.c editmode.c ---> $(TARGET)"
	$(CC) $(CFLAGS_RELEASE) 7ed.c functions.c startmode.c editmode.c -o $(TARGET)
	echo "$(TARGET) is done."