forked from ghorn/mathlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (41 loc) · 1.05 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
## Mathlib Makefile
## Matt Peddie
UNAME := $(shell uname)
Q ?= @
SRC = filters.c misc_math.c quat.c spatial_rotations.c xyz.c
AP_PROJECT_DIR ?= ../
CONFTRON_DIR ?= $(AP_PROJECT_DIR)/conftron
OBJ = $(SRC:%.c=%.o)
## Compile pedantically and save pain later
WARNINGFLAGS ?= -Wall -Wextra -Werror
DEBUGFLAGS ?= -g -DDEBUG # -pg to generate profiling information
FEATUREFLAGS ?=
OPTFLAGS ?=
INCLUDES ?=
LDFLAGS ?= -lm
## thanks so much, Steve Jobs.
ifeq ($(UNAME),Darwin)
LDFLAGS += -L/opt/local/lib
LDFLAGS += -L/usr/local/lib
INCLUDES += -I/opt/local/include
INCLUDES += -isystem /usr/local/include
else
OPTFLAGS += -march=native -O3
endif
include $(CONFTRON_DIR)/includes
LDFLAGS += $(WARNINGFLAGS)
CFLAGS ?= $(WARNINGFLAGS) $(DEBUGFLAGS) $(FEATUREFLAGS) $(INCLUDES) $(OPTFLAGS) -std=gnu99
CC ?= gcc
.PHONY: clean
all: $(OBJ)
%.o : %.c
@echo CC $@
$(Q)$(CC) $(CFLAGS) -c $< -o $@
conftron:
$(MAKE) -C $(CONFTRON_DIR) AIRCRAFT=$(AIRCRAFT)
conf: conftron
config: conftron
clean:
rm -f $(OBJ)
megaclean: clean
$(MAKE) -C $(CONFTRON_DIR) clean