-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (81 loc) · 2.06 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# Simple Makefile for my C Processor as command processor..
#
all: pre-build main-build
pre-build:
@echo ">>> PRE BUILD <<<"
@if [ -e ./cicanura ]; \
then \
(cd cicanura && git pull); \
else \
git clone https://github.com/rludva/cicanura.git; \
fi;
(cd cicanura && make target);
post-build:
@echo ">>> POST BUILD <<<"
@$(MAKE) --no-print-directory tests
main-build: target
@$(MAKE) --no-print-directory post-build
# Run the tests..
tests:
@if [ ! -e ./test_runner/test_runner ]; \
then \
echo "Error: ./test_runner/test_runner is not exist!"; \
echo ""; \
fi
@./cicanura/test_runner/test_runner
@./test_runner/test_runner
# Target for test_runner..
target: \
./application/interface.o \
./core/test/test_cprocessor.o \
./core/source/cprocessor.o \
./test_runner/test_runner.o
cc -o ./application/interface \
./application/interface.o \
./cicanura/core/source/strings.o \
./cicanura/core/source/collection.o \
./core/source/cprocessor.o
# Build test_runner..
cc -o ./test_runner/test_runner \
./test_runner/test_runner.o \
./core/test/test_cprocessor.o \
./core/source/cprocessor.o \
./cicanura/core/source/strings.o \
./cicanura/core/source/collection.o \
./cicanura/core/source/ctest.o
# C Processor
./core/source/cprocessor.o: \
./core/source/cprocessor.c \
./core/include/cprocessor.h
# Test for C Processor
./core/test/test_cprocessor.o: \
./core/test/test_cprocessor.c \
./core/source/cprocessor.o
# Test runner
./test_runner/test_runner.o: \
./test_runner/test_runner.c \
./core/test/test_cprocessor.o \
./core/source/cprocessor.o \
./cicanura/core/source/ctest.o
#
./application/interface.o: \
./application/interface.c \
./core/include/cprocessor.h
# Clean the outputs..
clean:
@(cd cicanura && make clean);
@for soubor in \
./application/interface \
./application/interface.o \
./core/test/test_cprocessor.o \
./core/source/cprocessor.o \
./test_runner/test_runner.o \
./test_runner/test_runner; \
do \
if [ -e $$soubor ]; \
then \
echo "Removing: $$soubor"; \
rm $$soubor; \
fi; \
done