-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
58 lines (43 loc) · 1.38 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
# type
# 'make' to compile mixture model as run_mix
# 'make admix' to compile mixture model as run_admix
CC=gcc
CFLAGS=-std=c17 -Wall -Wextra -pedantic -O3 #-ffast-math (does not respect IEEE) -funroll-all-loops (usually makes programs run slower)
#CFLAGS=-std=c99 -Wall -W -pedantic -pg -O1
LDFLAGS=-lm #-fleading-underscore -I/home/tuf29140/lapack/lapack-3.4.2/lapacke/include/ -L/home/tuf29140/lapack/lapack-3.4.2 #-L/usr/lib64/atlas/ -I/usr/include -llapack -L/home/tuf29140/lapack/CBLAS/lib/#-I/usr/local/include -L/usr/local/lib -lgsl -l gslcblas
ifdef DBG
CFLAGS=-std=c17 -Wall -Wextra -pedantic -g
endif
ifdef OLDWAY
CFLAGS := $(CFLAGS) -DOLDWAY
endif
ifdef NEWWAY
CFLAGS := $(CFLAGS) -DNEWWAY
endif
ifdef LAPACK
CFLAGS := $(CFLAGS) -DLAPACK
LDFLAGS := $(LDFLAGS) -llapack
endif
# Local variables
SRC = $(wildcard *.c)
SRC := $(SRC:convert.c=)
SRC := $(SRC:test.c=)
HDR = $(wildcard *.h)
OBJ = $(SRC:.c=.o)
DEP = $(SRC:.c=.d)
EXE = multiclust
multiclust : $(OBJ)
$(CC) $(CFLAGS) -o multiclust $(OBJ) $(LDFLAGS)
convert : convert.o
$(CC) $(CFLAGS) -o convert convert.o $(LDFLAGS)
test : $(OBJ)
$(CC) $(CFLAGS) -o multiclust.test $(OBJ) $(LDFLAGS)
include $(DEP)
%.d : %.c
-@$(SHELL) -ec '$(CC) -MM $(CFLAGS) $(IFLAGS) $< \
| sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@'
.PHONY : clean cleanall
clean:
@rm -f *.o *.d 2> /dev/null
cleanall:
@rm -f *.o *.d $(EXE) 2> /dev/null