-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from carandraug/pkg-config
Makefile: use pkg-config to find fftw3 flags instead of hardcoded values
- Loading branch information
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |