-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (41 loc) · 1.48 KB
/
Makefile
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
46
47
48
49
50
51
52
53
54
55
CC = gcc
CFLAGS = -Iinclude
EXEC= ./build/pips
INSTALLDIR= /usr/local/bin
build/pips: build build/main.o include/config.h include/config.h build/exec.o build/parser.o build/utils.o build/defs.o build/reader.o build/hashmaps.o include/types.h
$(CC) build/main.o build/exec.o build/parser.o build/utils.o build/defs.o build/reader.o build/hashmaps.o -lm -o $(EXEC)
build/main.o: src/main.c include/main.h
$(CC) $(CFLAGS) src/main.c -c -o build/main.o
build/exec.o: src/exec.c include/exec.h
$(CC) $(CFLAGS) src/exec.c -c -o build/exec.o
build/parser.o: src/parser.c include/parser.h
$(CC) $(CFLAGS) src/parser.c -c -o build/parser.o
build/utils.o: src/utils.c include/utils.h
$(CC) $(CFLAGS) src/utils.c -c -o build/utils.o
build/defs.o: src/defs.c include/defs.h
$(CC) $(CFLAGS) src/defs.c -c -o build/defs.o
build/reader.o: src/reader.c include/reader.h
$(CC) $(CFLAGS) src/reader.c -c -o build/reader.o
build/hashmaps.o: src/hashmaps.c include/hashmaps.h
$(CC) $(CFLAGS) src/hashmaps.c -c -o build/hashmaps.o
build:
mkdir build
install: build/pips
@echo "Installing Pipescript"
@echo "Installing in $(INSTALLDIR)"
cp -f $(EXEC) $(INSTALLDIR)/pips
chmod 755 $(INSTALLDIR)/pips
remove:
@echo "Removing Pipescript"
rm $(INSTALLDIR)/pipescript
test:
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
$(EXEC) test.pipescript
run:
@echo "------------------"
@$(EXEC) test.pipescript
@echo "------------------"
clean:
@rm -rf build