forked from andrei-v-frolov/curvecaptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
118 lines (79 loc) · 2.25 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
################################################################
# $Id: Makefile,v 1.6 2005/06/02 22:14:48 afrolov Exp $
# Makefile for Curve Captor source code
################################################################
SHELL = /bin/sh
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
DATADIR = $(PREFIX)/share/valves
CC = gcc
LD = ld
AR = ar -r
RANLIB = ranlib
INSTALL = install
VERSION = 0.9.1
################################################################
# Configuration
################################################################
# Define if you want debugging code compiled in
# DEBUG = 1
# Define if you have getline() available
HAVE_GETLINE = 1
# Define if you have FFTW library (for distortion analysis)
# HAVE_FFTW = 1
FFTINCS = -I$(HOME)/local/include
FFTLIBS = -L$(HOME)/local/lib -lrfftw -lfftw
# Compiler flags
ifdef DEBUG
CFLAGS = -g -pg -Wall
DEFINES = -DDEBUG -DVERSION='"$(VERSION) (debugging on)"' -DDATADIR='"$(DATADIR)"'
LDFLAGS = -pg
else
CFLAGS = -O3 -march=i386 -mcpu=pentium4
DEFINES = -DVERSION='"$(VERSION)"' -DDATADIR='"$(DATADIR)"'
LDFLAGS =
endif
INCLUDE =
LIBS = -lm
ifdef HAVE_GETLINE
DEFINES:= -DHAVE_GETLINE $(DEFINES)
endif
ifdef HAVE_FFTW
DEFINES:= -DHAVE_FFTW $(DEFINES)
INCLUDE:= $(FFTINCS) $(INCLUDE)
LIBS := $(FFTLIBS) $(LIBS)
endif
ALLFLAGS = $(CFLAGS) $(DEFINES) $(INCLUDE)
################################################################
# Dependencies
################################################################
# Files
hdrs = $(wildcard *.h)
objs = $(wildcard *.o *.a)
bins = tubefit
dist = curvecaptor-$(VERSION).tar.gz
# Targets
.PHONY: all clean distclean install tarball
all: $(bins)
clean:
rm -f $(objs) gmon.out
distclean: clean
rm -f $(bins)
install: $(bins)
$(INSTALL) -d $(BINDIR)
$(INSTALL) -s $(bins) $(BINDIR)
$(INSTALL) curvecaptor $(BINDIR)
tarball: $(dist)
# Dependencies
tubefit: tubefit.o
$(dist): README Makefile curvecaptor tubefit.c models.m4
tar cvf $(basename $@) $^; gzip -f -9 $(basename $@)
################################################################
# Implicit rules
################################################################
# Production rules
%.o: %.c $(hdrs)
$(CC) $(ALLFLAGS) -c $< -o $@
%: %.o
$(CC) $(LDFLAGS) $^ $(LIBS) -o $@