Debian Codegraph @

nifti2/Makefile

raw
1
2 # note the TARFILE_NAME embeds the release version number
3 TARFILE_NAME = nifti2clib-0.0.1
4
5 USEZLIB = -DHAVE_ZLIB
6
7 ## Compiler defines
8 CC = gcc
9 IFLAGS = -I. -I../niftilib -I../znzlib
10 CFLAGS = -Wall -std=gnu99 -pedantic $(USEZLIB) $(IFLAGS)
11
12 LLIBS = -lz -lm
13
14 MISC_OBJS = nifticdf.o znzlib.o
15 OBJS = nifti2_io.o $(MISC_OBJS)
16
17 TOOLS = nifti_tool nifti1_tool nifti2_tool
18 EXAMPLES = clib_02_nifti2
19
20
21 # --------------------------------------------------
22 # default compile for C files
23 %.o : %.c %.h
24 $(CC) -c $(CFLAGS) $< -o $@
25
26 # --------------------------------------------------
27 # main targets (primary is nifti_tool, for now)
28
29 nifti_tool: nifti_tool.o nifti_tool.h nifti2objs
30 $(CC) -o $@ $(CFLAGS) $< $(OBJS) $(LLIBS)
31
32 all: $(TOOLS) $(EXAMPLES)
33
34 clean:
35 $(RM) *.o $(TOOLS) $(EXAMPLES)
36
37 nifti2objs: $(OBJS)
38
39 clib_02_nifti2: clib_02_nifti2.o nifti2objs
40 $(CC) -o $@ $(CFLAGS) $< $(OBJS) $(LLIBS)
41
42 # --------------------------------------------------
43 # targets from source residing elsewhere
44 nifticdf.o:
45 $(CC) -c $(CFLAGS) ../nifticdf/nifticdf.c -o $@
46
47 znzlib.o:
48 $(CC) -c $(CFLAGS) ../znzlib/znzlib.c -o $@
49
50 # maybe we want to build NIFTI-1 nifti_tool
51 nifti1_tool: $(MISC_OBJS)
52 $(CC) -o $@ -I../utils $(CFLAGS) \
53 ../niftilib/nifti_tool.c ../niftilib/nifti1_io.c $(MISC_OBJS) $(LLIBS)
54
55 # make non-clashing version
56 nifti2_tool: nifti_tool
57 cp -p nifti_tool nifti2_tool