-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
61 lines (47 loc) · 1.54 KB
/
makefile
File metadata and controls
61 lines (47 loc) · 1.54 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
USE_ECM ?= 1
CC = gcc
CFLAGS = -O3 -std=c99 -Wall -Wextra -g -I./src -I/usr/local/include
LDFLAGS = -lreadline -L/usr/local/lib -lgmp -lm
ifeq ($(USE_ECM), 1)
CFLAGS += -I./src/external/ecm
LDFLAGS := src/external/ecm/.libs/libecm.a $(LDFLAGS)
ECM_TARGET = src/external/ecm/.libs/libecm.a
else
CFLAGS += -DNO_ECM
ECM_TARGET =
endif
ifneq ($(wildcard /opt/homebrew/include),)
CFLAGS += -I/opt/homebrew/include
endif
ifneq ($(wildcard /opt/homebrew/lib),)
LDFLAGS += -L/opt/homebrew/lib
endif
SRC_DIR = src
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ = $(SRC:.c=.o)
TARGET = picocas
TEST_BINARIES = eval_tests expr_tests parse_tests test_ld test_ops test_pattern list_tests stats_tests expand_tests
TEST_DIR = tests
CMAKE_TEST_BINARIES = comparisons_tests eval_tests expr_tests match_tests match_extensive_tests parse_tests regression_tests symtab_tests list_tests trig_tests hyperbolic_tests logexp_tests piecewise_tests purefunc_tests stats_tests expand_tests
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
src/external/ecm/.libs/libecm.a:
./build_ecm.sh
$(SRC_DIR)/%.o: $(SRC_DIR)/%.c $(ECM_TARGET)
$(CC) $(CFLAGS) -c $< -o $@
$(SRC_DIR)/boolean.o: $(SRC_DIR)/boolean.c
$(CC) $(CFLAGS) -c $< -o $@
$(SRC_DIR)/list.o: $(SRC_DIR)/list.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) $(TARGET)
rm -rf *.dSYM
rm -f $(TEST_BINARIES)
rm -f *~
rm -f $(SRC_DIR)/*~
rm -f $(TEST_DIR)/*~
rm -f *.o
if [ -f $(TEST_DIR)/Makefile ]; then $(MAKE) -C $(TEST_DIR) clean; fi
rm -f $(addprefix $(TEST_DIR)/, $(CMAKE_TEST_BINARIES))
.PHONY: all clean