-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·67 lines (56 loc) · 1.41 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
58
59
60
61
62
63
64
65
66
67
# =========================================================================
# libevol makefile
#
# Copyright (c) 2016, Yang LIU <[email protected]>
# =========================================================================
IDIR = /usr/local/include
ODIR = build
SRCDIR = src
DEMODIR = demo
TARGETDIR = bin
CC = gcc
CFLAGS = -I$(IDIR) -g -Wall
# CFLAGS += -DWITHSTATS
CFLAGS += -DNDEBUG
CFLAGS += -O3
CFLAGS += -std=c99
LDIR = -L/usr/local/lib
LIBS = -lm
# LIBS += -lczmq -lzmq
_MODULES = arrayi \
arrayset \
arrayu \
date_ext \
evol \
hash \
listu \
listx \
matrixd \
matrixu \
numeric_ext \
queue \
deps/pcg/entropy \
rng \
string_ext \
timer
_OBJS = $(_MODULES:=.o)
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
LIBTARGET = libevol.a
TESTOBJS = $(OBJS) $(ODIR)/selftest.o
TESTTARGET = $(TARGETDIR)/selftest
INSTALLPREFIX = /usr/local
.PHONY: clib install test clean
$(ODIR)/%.o: $(SRCDIR)/%.c
@mkdir -p $(@D)
$(CC) -c $< -o $@ $(CFLAGS)
clib: $(OBJS)
ar rcs $(LIBTARGET) $(OBJS)
install: clib
install $(LIBTARGET) $(INSTALLPREFIX)/lib
install -m 0644 include/*.h $(INSTALLPREFIX)/include
test: $(TESTOBJS)
mkdir -p $(TARGETDIR)
$(CC) -o $(TESTTARGET) $(TESTOBJS) $(CFLAGS) $(LDIR) $(LIBS)
$(TESTTARGET)
clean:
rm -rf $(TARGETDIR)/* *.dll *.a $(ODIR)/*