File: Makefile

package info (click to toggle)
gifticlib 1.0.9-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 832 kB
  • sloc: ansic: 13,453; csh: 81; makefile: 41; sh: 26
file content (58 lines) | stat: -rw-r--r-- 1,418 bytes parent folder | download | duplicates (5)
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

# quick and dirty (getting dirtier) for now...

# might not have zlib
APPLY_ZLIB = -DHAVE_ZLIB

NIFTI_DIR = ../nifti

LIBTOOL = libtool

C_LIBFLAGS = -03 -fPIC -DPIC $(APPLY_ZLIB)
INST_DIR = /usr/lib
VER = 1.0.0

# CFLAGS = -Wall -Wextra -g -pedantic -std=c99 $(APPLY_ZLIB)
CFLAGS = -O3 $(APPLY_ZLIB)
IFLAGS = -I$(NIFTI_DIR)/include
LFLAGS = -L$(NIFTI_DIR)/lib

CC = gcc $(CFLAGS)

# for macs (getting expat from fink)
# IFLAGS = -I/sw/include $(IFLAGS)
# LFLAGS = -L/sw/lib $(LFLAGS)

gifti_tool: gifti_tool.o gifti_io.o gifti_xml.o
	$(RM) $@
	$(CC) -o $@ gifti_tool.o gifti_io.o gifti_xml.o \
	      $(LFLAGS) -lexpat -lniftiio -lznz -lz -lm

gifti_test: gifti_test.o gifti_io.o gifti_xml.o
	$(RM) $@
	$(CC) -o $@ gifti_test.o gifti_io.o gifti_xml.o \
	      $(LFLAGS) -lexpat -lniftiio -lznz -lz -lm

libgiftiio_la:
	$(LIBTOOL) --mode=compile $(CC) $(IFLAGS) -o gifti_io.lo -c gifti_io.c
	$(LIBTOOL) --mode=compile $(CC) $(IFLAGS) -o gifti_xml.lo -c gifti_xml.c
	$(LIBTOOL) --mode=link $(CC) -release $(VER) -o libgiftiio.la gifti_io.lo gifti_xml.lo -rpath $(INST_DIR) $(LFLAGS) -lexpat -lniftiio -lznz -lz -lm

libgiftiio: libgiftiio_la
	$(LIBTOOL) --mode=install install -c libgiftiio.la $(INST_DIR)

all: gifti_tool gifti_test libgiftiio

clean:
	$(RM) gifti_tool *.o

clean_all:
	$(RM) gifti_test gifti_tool *.o
	$(RM) gifti*.lo*
	$(RM) libgifti*.la
	$(RM) *.so

%.o: %.c %.h
	$(RM) $@
	$(CC) $(IFLAGS) -c $<