-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (37 loc) · 776 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
35
36
37
38
39
40
41
42
43
44
45
46
# compile flags
SDL=1
TIFF_ENABLE=0
OPTIMIZATION_LEVEL=3
FFTW3_THREADS=1
# object files
OBJ=fishstep.o
# compilers
CC=gcc
# SDL options
ifeq ($(SDL),1)
SDL_OPTS=-DSDL=1 `sdl-config --libs` `sdl-config --cflags`
else
SDL_OPTS=
endif
# TIFFLib options
ifeq ($(TIFF_ENABLE),1)
TIFFLIB_OPTS=-DTIFF_ENABLE=1 -ltiff
else
TIFFLIB_OPTS=
endif
# FFTW3 options
ifeq ($(FFTW3_THREADS),1)
FFTW3_OPTS=-DFFTW3_THREADS=1 -lfftw3_threads
else
FFTW3_OPTS=
endif
# compiler options
OPTS=-Wall -pthread
CFLAGS=-O$(OPTIMIZATION_LEVEL) -lm -lrt -lfftw3
fishstep: $(OBJ)
$(CC) -o $@ $+ $(OPTS) $(CFLAGS) $(SDL_OPTS) $(TIFFLIB_OPTS) $(FFTW3_OPTS)
fishstep.o: fishstep.c
$(CC) $(OPTS) $(CFLAGS) $(SDL_OPTS) $(TIFFLIB_OPTS) $(FFTW3_OPTS) -c $<
.PHONY: clean
clean:
rm *.o fishstep