-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (32 loc) · 1.07 KB
/
Makefile
File metadata and controls
45 lines (32 loc) · 1.07 KB
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
36
37
38
39
40
41
42
43
44
45
CC?= gcc
# -fsanitize=address
CFLAGS?= -g -O2 -std=c89 -pedantic-errors -Wdeclaration-after-statement -Wvla -Iinclude -Wall -Wframe-larger-than=2048 -Wno-implicit-function-declaration -Wno-unused-variable -Wno-unused-result -Wno-strict-prototypes
CFLAGS_REL= -O2 -std=c89 -Iinclude -fomit-frame-pointer -fconserve-stack -Wall -Wframe-larger-than=2048 -Wno-implicit-function-declaration -Wno-unused-variable -Wno-unused-result
LDFLAGS= -lm
SRCS:= $(wildcard src/*.c) \
$(wildcard include/*.c)
OBJS:= $(SRCS:.c=.o)
BIN= well
PREFIX= /usr
.PHONY: all base run_test vim clean_vim clean
all: base
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
base: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN)
release: $(OBJS)
$(CC) $(CFLAGS_REL) $(LDFLAGS) $(OBJS) -o $(BIN)
run_test:
well tests/helloWorld/helloworld.well -i
install:
cp $(BIN) $(PREFIX)/bin
vim:
mkdir -p ~/.vim/syntax
mkdir -p ~/.vim/ftdetect
cp vim/syntax/well.vim ~/.vim/syntax/
cp vim/ftdetect/well.vim ~/.vim/ftdetect/
clean_vim:
rm -f ~/.vim/syntax/well.vim
rm -f ~/.vim/ftdetect/well.vim
clean:
rm $(OBJS) $(BIN)