File: sample-GNUmakefile

package info (click to toggle)
insighttoolkit 3.20.1%2Bgit20120521-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 80,652 kB
  • sloc: cpp: 458,133; ansic: 196,223; fortran: 28,000; python: 3,839; tcl: 1,811; sh: 1,184; java: 583; makefile: 430; csh: 220; perl: 193; xml: 20
file content (94 lines) | stat: -rw-r--r-- 3,162 bytes parent folder | download | duplicates (3)
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
#  
# NrrdIO: stand-alone code for basic nrrd functionality
# Copyright (C) 2008, 2007, 2006, 2005  Gordon Kindlmann
# Copyright (C) 2004, 2003, 2002, 2001, 2000, 1999, 1998  University of Utah
#
# This software is provided 'as-is', without any express or implied
# warranty.  In no event will the authors be held liable for any
# damages arising from the use of this software.
#
# Permission is granted to anyone to use this software for any
# purpose, including commercial applications, and to alter it and
# redistribute it freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must
#    not claim that you wrote the original software. If you use this
#    software in a product, an acknowledgment in the product
#    documentation would be appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must
#    not be misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution.
#

### For the time being, this will have to do as a makefile for NrrdIO

### These have to be set to reflect the current platform:
###
### -DTEEM_DIO=0, -DTEEM_DIO=1: This platform can (1) or cannot (0) do
### DirectIO, which is the fast way to do multi-gigabyte I/O.
### Currently, only available on SGIs.
###
### -DTEEM_32BIT=0, -DTEEM_32BIT=1: This platform is a 32-bit (1) or a
### 64-bit machine (0)
###
### -DTEEM_ENDIAN=4321, -DTEEM_ENDIAN=1234: The platform is big-endian
### (4321) or little-endian (1234)
###
### -DTEEM_QNANHIBIT=1, -DTEEM_QNANHIBIT=0: The 23nd bit of a 32-bit
### quiet-NaN is either 1 (1) or 0 (0).  This is needed as part of
### handling IEEE floating point special values.  This quantity is
### independent of endianness.
###
###
PLATFORM_DEFS = \
  -DTEEM_DIO=0 \
  -DTEEM_32BIT=1 \
  -DTEEM_ENDIAN=1234 \
  -DTEEM_QNANHIBIT=1

### Any architecture-specific flags to cc
###
CCFLAGS = -O3 -ffloat-store -W -Wall -I$(ITK_BIN_ROOT)/Utilities -I$(ITK_SRC_ROOT)/Utilities

### This also has to be set per-architecture- whether or not we need to
### run ranlib on libraries created via ar
###
RANLIB = ranlib

### Assuming NrrdIO will be built with zlib enabled (due to "-DTEEM_ZLIB=1"
### on the source compilation, below), these (may) need to be set to help 
### find the zlib includes and libraries
###
ZLIB_IPATH =
ZLIB_LPATH =$(ITK_BIN_ROOT)/bin/libitkzlib.a

### We'll build the static libNrrdIO library, and one test program
###
ALL = libNrrdIO.a sampleIO 
all: $(ALL)

### The libNrrdIO library is built from the objects from the source files
### named in NrrdIO_Srcs.txt
###
libNrrdIO.a : $(patsubst %.c,%.o,$(shell cat NrrdIO_Srcs.txt))
	ar ru $@ $^
	$(if $(RANLIB),$(RANLIB) $@,)

### Compiling the source files will also have some platform-specific stuff
###
%.o : %.c
	cc $(CCFLAGS) $(PLATFORM_DEFS) \
          -DTEEM_ZLIB=1 $(ZLIB_IPATH) -c $^ -o $@

### this creates the sampleIO program
###
sampleIO : sampleIO.c
	cc $(CCFLAGS) $(PLATFORM_DEFS) -DTEEM_ZLIB=1 $(ZLIB_IPATH) \
	$^ -o $@ -L. -lNrrdIO $(ZLIB_LPATH) -lz -lm

### how to clean up
###
clean :
	rm -f *.o $(ALL)