forked from AprilRobotics/apriltag
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (31 loc) · 865 Bytes
/
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
PREFIX ?= /usr/local
CC = gcc
AR = ar
CFLAGS = -std=gnu99 -fPIC -Wall -Wno-unused-parameter -Wno-unused-function
CFLAGS += -I. -O3 -fno-strict-overflow
APRILTAG_SRCS := $(shell ls *.c common/*.c)
APRILTAG_HEADERS := $(shell ls *.h common/*.h)
APRILTAG_OBJS := $(APRILTAG_SRCS:%.c=%.o)
TARGETS := libapriltag.a libapriltag.so
.PHONY: all
all: $(TARGETS)
@$(MAKE) -C example all
.PHONY: install
install: libapriltag.so
@chmod +x install.sh
@./install.sh $(PREFIX)/lib libapriltag.so
@./install.sh $(PREFIX)/include/apriltag $(APRILTAG_HEADERS)
@ldconfig
libapriltag.a: $(APRILTAG_OBJS)
@echo " [$@]"
@$(AR) -cq $@ $(APRILTAG_OBJS)
libapriltag.so: $(APRILTAG_OBJS)
@echo " [$@]"
@$(CC) -fPIC -shared -o $@ $^
%.o: %.c
@echo " $@"
@$(CC) -o $@ -c $< $(CFLAGS)
.PHONY: clean
clean:
@rm -rf *.o common/*.o $(TARGETS)
@$(MAKE) -C example clean