Skip to content

Commit

Permalink
Merge pull request #12 from carandraug/pkg-config
Browse files Browse the repository at this point in the history
Makefile: use pkg-config to find fftw3 flags instead of hardcoded values
  • Loading branch information
Piotr Wendykier committed Aug 24, 2017
2 parents d775e81 + 53979b2 commit 3c3253f
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/test/resources/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
fftwdir = "E:\devel\fftw-3.2.2"

CC = gcc
CFLAGS = -I$(fftwdir)
LDFLAGS = -L$(fftwdir) -lm -lfftw3-3

all: genref1d
genref1d.o: genref1d.c
gcc -c genref1d.c $(CFLAGS)
genref1d: genref1d.o
gcc -o genref1d genref1d.o $(LDFLAGS)
LDFLAGS = -lm -lfftw3

XTRA_CFLAGS = $(shell pkg-config --cflags fftw3)
XTRA_LDFLAGS = -lm $(shell pkg-config --libs fftw3)

all: genref1d

genref1d.o: genref1d.c
$(CC) -c genref1d.c $(XTRA_CFLAGS)

genref1d: genref1d.o
$(CC) -o genref1d genref1d.o $(XTRA_LDFLAGS)

clean:
$(RM) genref1d genref1d.o

0 comments on commit 3c3253f

Please sign in to comment.