forked from Moodstocks/jpec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 655 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 655 Bytes
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
rm=rm -f
CC=cc
AR=ar cq
RANLIB=ranlib
LIBNAME=libjpec.a
CLINAME=jpec
# LIB_BUILD_MODE: release or debug
LIB_BUILD_MODE=release
INCLUDES= -Isrc -Iinclude
DEFINES= $(INCLUDES)
_release_cflags= -Os -DNDEBUG
_debug_cflags= -g -O0
CFLAGS= $(DEFINES) -std=c99 -Wall -Werror
CFLAGS+= $(_$(LIB_BUILD_MODE)_cflags)
SRCS = $(wildcard src/*.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))
%.c.o:
$(CC) $(CFLAGS) -c $*.c
all: $(CLINAME) $(LIBNAME)
$(LIBNAME): $(OBJS)
$(rm) $@
$(AR) $@ $(OBJS)
$(RANLIB) $@
$(CLINAME): $(LIBNAME) main.c
$(CC) -std=c99 `pkg-config --cflags --libs opencv` -Iinclude -L. -l$@ main.c -o $@
clean:
$(rm) $(OBJS) $(CLINAME) $(LIBNAME)