forked from HPAC/pmrrr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (25 loc) · 840 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
include ./make.inc
DIRS = ./INCLUDE ./SRC ./SRC/LAPACK ./SRC/BLAS
CFLAGS += -I./INCLUDE
ifeq ($(SPINLOCK_SUPPORT),0)
CFLAGS += -DNOSPINLOCKS
endif
# Source files
HEADERS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.h))
CSRCS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.c))
COBJS = $(CSRCS:.c=.o)
FSRCS := $(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.f))
FOBJS = $(FSRCS:.f=.o)
# Build target #
libpmrrr.a: $(COBJS) $(FOBJS) $(HEADERS)
$(AR) $(ARFLAGS) ./LIB/libpmrrr.a $(COBJS) $(FOBJS)
$(COBJS): $(HEADERS)
$(FOBJS):
.PHONY: clean
clean:
rm -f *~ core.* *__genmod* \
./INSTALL/*~ \
$(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.o)) \
$(foreach DIR,$(DIRS),$(wildcard $(DIR)/*~)) \
$(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.mod.*)) \
$(foreach DIR,$(DIRS),$(wildcard $(DIR)/*__genmod*))