File: Makefile

package info (click to toggle)
nifticlib 3.0.1-9.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,640 kB
  • sloc: ansic: 31,214; sh: 941; makefile: 460; csh: 138; python: 88; tcl: 42
file content (57 lines) | stat: -rw-r--r-- 1,407 bytes parent folder | download | duplicates (4)
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

# note the TARFILE_NAME embeds the release version number
TARFILE_NAME	= nifti2clib-0.0.1

USEZLIB         = -DHAVE_ZLIB

## Compiler  defines
CC		= gcc
IFLAGS          = -I. -I../niftilib -I../znzlib
CFLAGS          = -Wall -std=gnu99 -pedantic $(USEZLIB) $(IFLAGS)

LLIBS 		= -lz -lm

MISC_OBJS	= nifticdf.o znzlib.o
OBJS	   	= nifti2_io.o $(MISC_OBJS)

TOOLS 	   	= nifti_tool nifti1_tool nifti2_tool
EXAMPLES   	= clib_02_nifti2


# --------------------------------------------------
# default compile for C files
%.o : %.c %.h
	$(CC) -c $(CFLAGS) $< -o $@

# --------------------------------------------------
# main targets (primary is nifti_tool, for now)

nifti_tool: nifti_tool.o nifti_tool.h nifti2objs
	$(CC) -o $@ $(CFLAGS) $< $(OBJS) $(LLIBS)

all: $(TOOLS) $(EXAMPLES)

clean:
	$(RM) *.o $(TOOLS) $(EXAMPLES)

nifti2objs: $(OBJS)

clib_02_nifti2: clib_02_nifti2.o nifti2objs
	$(CC) -o $@ $(CFLAGS) $< $(OBJS) $(LLIBS)

# --------------------------------------------------
# targets from source residing elsewhere
nifticdf.o:
	$(CC) -c $(CFLAGS) ../nifticdf/nifticdf.c -o $@

znzlib.o:
	$(CC) -c $(CFLAGS) ../znzlib/znzlib.c -o $@

# maybe we want to build NIFTI-1 nifti_tool
nifti1_tool: $(MISC_OBJS)
	$(CC) -o $@ -I../utils $(CFLAGS) \
	../niftilib/nifti_tool.c ../niftilib/nifti1_io.c $(MISC_OBJS) $(LLIBS)

# make non-clashing version
nifti2_tool: nifti_tool
	cp -p nifti_tool nifti2_tool