-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
43 lines (31 loc) · 1.17 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
# compilers
CC = gcc
GIT = git
# compiler flags
OFLAGS = -O3
WFLAGS = -Wall -Wno-unused-function
CFLAGS = $(OFLAGS) $(WFLAGS) -std=c99 -pipe -DMM_VERSION=\"$(VERSION)\"
LDFLAGS = -lm -lz -lpthread
# default version string is parsed from git tags, otherwise extracted from the source
VERSION = $(shell $(GIT) describe --tags || grep "define MM_VERSION" minialign.c | grep -o '".*"' | sed 's/"//g')
# install directory and binary name
PREFIX = /usr/local
TARGET = minialign
all: native
native:
$(MAKE) -f Makefile.core CC=$(CC) CFLAGS='$(CFLAGS)' all
$(CC) -o $(TARGET) $(CFLAGS) minialign.o gaba.*.o $(LDFLAGS)
sse41 avx2:
$(MAKE) -f Makefile.core CC=$(CC) CFLAGS='$(CFLAGS) -DUNITTEST=0' ARCH=`echo $@ | tr a-z A-Z` NAMESPACE=$@ all
universal: sse41 avx2
$(CC) -o $(TARGET) $(CFLAGS) -mtune=generic universal.c minialign.*.o gaba.*.o $(LDFLAGS)
clean:
rm -fr gmon.out *.o a.out $(TARGET) *~ *.a *.dSYM session*
install:
mkdir -p $(PREFIX)/bin
cp $(TARGET) $(PREFIX)/bin/$(TARGET)
uninstall:
rm -f $(PREFIX)/bin/$(TARGET)
gaba.c: gaba.h log.h unittest.h sassert.h
gaba_wrap.h: gaba.h log.h unittest.h sassert.h
minialign.c: kvec.h ksort.h gaba_wrap.h lmm.h unittest.h sassert.h