-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (46 loc) · 1.35 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
# This file is part of fftautocorr
#
# Copyright (C) 2020 CareF
# Author: CareF
# Licensed under a 3-clause BSD style license - see LICENSE.md
#
# The library is intended to be used at source code level. FFTW and pocketfft
# dependencies is introduced only for testing purposes.
#
# The Makefile is presented as a demo of compilation and as infrastructure
# for testing purposes. Compilation settings may vary depending on the platform.
CFLAGS += -O3 -Wall
TESTFLAGS += -lfftw3
ifeq ($(OS),Windows_NT)
echo Win not tested!
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
TESTFLAGS += -L/usr/local/lib -I/usr/local/include
else
# Assuming linux
LDLIBS += -lm
endif
endif
.PHONY : test clean
.DEFAULT_GOAL := fftautocorr.o
.SECONDARY : fftautocorr.o
test: test.out
./test.out
test.out : test.c fftautocorr.o pocketfft.o
$(CC) $(CFLAGS) $^ $(LDLIBS) $(TESTFLAGS) $(LDFLAGS) -o $@
profile: profile.out
./profile.out 5
profile.out : profile.c fftautocorr.o
$(CC) $(CFLAGS) $^ $(LDLIBS) $(TESTFLAGS) $(LDFLAGS) -o $@
fftautocorr.o : fftautocorr.c fftautocorr.h factortable.h
$(CC) $(CFLAGS) -c $< -o $@
pocketfft.o : pocketfft/pocketfft.c pocketfft/pocketfft.h
$(CC) $(CFLAGS) -c $< -o $@
factortable.h : tablegen.py
./tablegen.py $@
pocketfft/% :
git clone https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git
.PHONY : clean
clean :
@$(RM) *.o test.out