-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.vc
89 lines (72 loc) · 2.56 KB
/
makefile.vc
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Makefile for tdinterp, Tensor-driven diffusion interpolation demo
# Pascal Getreuer
# April 3, 2011
#
# FFTW3 is required to build linterp. Windows DLLs are available at
# http://www.fftw.org/install/windows.html
# Please see readme.html for step by step instructions for compiling with MSVC.
#
# Please specify the locations of fftw3.h and the FFTW libs
#
FFTW_DIR = "D:/libs/fftw"
FFTW_INCLUDE = -I$(FFTW_DIR)
FFTW_LIB = $(FFTW_DIR)/libfftw3-3.lib $(FFTW_DIR)/libfftw3f-3.lib
#
# Uncomment and edit the following lines for JPEG support.
#
#LIBJPEG_DIR = "D:/libs/jpeg-8b"
#LIBJPEG_INCLUDE = -I$(LIBJPEG_DIR)
#LIBJPEG_LIB = $(LIBJPEG_DIR)/libjpeg.lib
#
# Uncomment and edit the following lines for PNG support.
#
#ZLIB_DIR = "D:/libs/zlib"
#ZLIB_INCLUDE = -I$(ZLIB_DIR)
#ZLIB_LIB = $(ZLIB_DIR)/zlib.lib
#LIBPNG_DIR = "D:/libs/lpng143"
#LIBPNG_INCLUDE = -I$(LIBPNG_DIR)
#LIBPNG_LIB = $(LIBPNG_DIR)/libpng.lib
##
# Standard make settings
CFLAGS=-O2 -W3 \
-D_CRT_SECURE_NO_WARNINGS \
$(FFTW_INCLUDE) $(LIBJPEG_INCLUDE) $(LIBPNG_INCLUDE) $(ZLIB_INCLUDE)
LDFLAGS=-NODEFAULTLIB:libcmtd -NODEFAULTLIB:msvcrt \
$(FFTW_LIB) $(LIBJPEG_LIB) $(LIBPNG_LIB) $(ZLIB_LIB)
##
# These statements add compiler flags to define LIBJPEG_SUPPORT, etc.,
# depending on which libraries have been specified above.
!IFDEF LIBJPEG_LIB
CJPEG=-DLIBJPEG_SUPPORT
!ENDIF
!IFDEF LIBPNG_LIB
CPNG=-DLIBPNG_SUPPORT
!ENDIF
ALLCFLAGS=$(CFLAGS) $(CJPEG) $(CPNG)
TDINTERP_SOURCES=tdinterpcli.c tdinterp.c conv.c finterp.c imageio.c basic.c
IMCOARSEN_SOURCES=imcoarsen.c imageio.c basic.c
IMDIFF_SOURCES=imdiff.c conv.c imageio.c basic.c
NNINTERP_SOURCES=nninterpcli.c nninterp.c imageio.c basic.c
TDINTERP_OBJECTS=$(TDINTERP_SOURCES:.c=.obj)
IMCOARSEN_OBJECTS=$(IMCOARSEN_SOURCES:.c=.obj)
IMDIFF_OBJECTS=$(IMDIFF_SOURCES:.c=.obj)
NNINTERP_OBJECTS=$(NNINTERP_SOURCES:.c=.obj)
.SUFFIXES: .c .obj
.PHONY: rebuild
rebuild: clean all
.PHONY: clean
clean:
del -f -q $(TDINTERP_OBJECTS) $(IMCOARSEN_OBJECTS) $(IMDIFF_OBJECTS) $(NNINTERP_OBJECTS) \
tdinterp.exe imcoarsen.exe imdiff.exe nninterp.exe
.PHONY: all
all: tdinterp.exe imcoarsen.exe imdiff.exe nninterp.exe
tdinterp.exe: $(TDINTERP_OBJECTS)
link $(LDFLAGS) $(TDINTERP_OBJECTS) -out:$@
imcoarsen.exe: $(IMCOARSEN_OBJECTS)
link $(LDFLAGS) $(IMCOARSEN_OBJECTS) -out:$@
imdiff.exe: $(IMDIFF_OBJECTS)
link $(LDFLAGS) $(IMDIFF_OBJECTS) -out:$@
nninterp.exe: $(NNINTERP_OBJECTS)
link $(LDFLAGS) $(NNINTERP_OBJECTS) -out:$@
.c.obj:
$(CC) -c $(ALLCFLAGS) -Tc $<