-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (41 loc) · 1.42 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
CC = gcc
CFLAGS = -Wall -ansi -pedantic
LIB_DIR = ./lib
SRC_DIR = ./src
BUILD_DIR = ./build
INCFLAGS = -I$(LIB_DIR)
LIBFLAGS = -L$(LIB_DIR) -lmod
LIB = $(LIB_DIR)/libmod.a
BIN = \
$(BUILD_DIR)/extendedGcdInt.out \
$(BUILD_DIR)/extendedGcdPoly.out \
$(BUILD_DIR)/evalPoly.out \
$(BUILD_DIR)/multipointEvalPoly.out \
$(BUILD_DIR)/euclideanDivisionPoly.out \
$(BUILD_DIR)/interpolationPoly.out
all: $(BIN)
$(LIB):
cd $(LIB_DIR) && make
$(BUILD_DIR):
mkdir $(BUILD_DIR)
$(BUILD_DIR)/extendedGcdInt.out: $(SRC_DIR)/mainExtendedGcdInt.c $(LIB) $(BUILD_DIR)
$(CC) $< $(CFLAGS) $(INCFLAGS) $(LIBFLAGS) -o $@
$(BUILD_DIR)/extendedGcdPoly.out: $(SRC_DIR)/mainExtendedGcdPoly.c $(LIB) $(BUILD_DIR)
$(CC) $< $(CFLAGS) $(INCFLAGS) $(LIBFLAGS) -o $@
$(BUILD_DIR)/evalPoly.out: $(SRC_DIR)/evalPoly.c $(LIB) $(BUILD_DIR)
$(CC) $< $(CFLAGS) $(INCFLAGS) $(LIBFLAGS) -o $@
$(BUILD_DIR)/multipointEvalPoly.out: $(SRC_DIR)/multipointEvalPoly.c $(LIB) $(BUILD_DIR)
$(CC) $< $(CFLAGS) $(INCFLAGS) $(LIBFLAGS) -o $@
$(BUILD_DIR)/euclideanDivisionPoly.out: $(SRC_DIR)/euclideanDivisionPoly.c $(LIB) $(BUILD_DIR)
$(CC) $< $(CFLAGS) $(INCFLAGS) $(LIBFLAGS) -o $@
$(BUILD_DIR)/interpolationPoly.out: $(SRC_DIR)/interpolationPoly.c $(LIB) $(BUILD_DIR)
$(CC) $< $(CFLAGS) $(INCFLAGS) $(LIBFLAGS) -o $@
docs:
doxygen Doxyfile
xdg-open docs/html/index.html
cleandocs:
rm -r docs
clean:
rm -rf $(BUILD_DIR)
cd $(LIB_DIR) && make clean
.PHONY: clean