-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (49 loc) · 1.54 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
CC=mpicc
AR=ar
DEBUG=-DENABLE_DRISHTI_LOGGING -g -O0
INCLUDES=-I$(HDF5_DIR)/include
CFLAGS = $(DEBUG) -fPIC $(INCLUDES) -Wall
LIBS=-L$(HDF5_DIR)/lib -lhdf5 -lz
# Uncomment this line Linux builds:
# DYNLDFLAGS = $(DEBUG) -shared -fPIC $(LIBS)
# Uncomment this line MacOS builds:
DYNLDFLAGS = $(DEBUG) -dynamiclib -current_version 1.0 -fPIC $(LIBS)
LDFLAGS = $(DEBUG) $(LIBS)
ARFLAGS = rs
DYNSRC = H5VLdrishti.c
DYNOBJ = $(DYNSRC:.c=.o)
# Uncomment this line Linux builds:
# DYNLIB = libh5drishti_vol.so
# Uncomment this line MacOS builds:
DYNLIB = libh5drishti_vol.dylib
DYNDBG = libh5drishti_vol.dylib.dSYM
#STATSRC = new_h5api.c
#STATOBJ = $(STATSRC:.c=.o)
#STATLIB = libnew_h5api.a
EXSRC = example.c
EXOBJ = $(EXSRC:.c=.o)
EXEXE = example.exe
EXDBG = example.exe.dSYM
ASYNC_EXSRC = async_new_h5api_ex.c
ASYNC_EXOBJ = $(ASYNC_EXSRC:.c=.o)
ASYNC_EXEXE = async_new_h5api_ex.exe
ASYNC_EXDBG = async_new_h5api_ex.exe.dSYM
DATAFILE = testfile.h5
all: $(EXEXE) $(ASYNC_EXEXE) $(DYNLIB) $(STATLIB)
$(EXEXE): $(EXSRC) $(STATLIB) $(DYNLIB)
$(CC) $(CFLAGS) $^ -o $(EXEXE) $(LDFLAGS)
$(ASYNC_EXEXE): $(ASYNC_EXSRC) $(STATLIB) $(DYNLIB)
$(CC) $(CFLAGS) $^ -o $(ASYNC_EXEXE) $(LDFLAGS)
$(DYNLIB): $(DYNSRC)
$(CC) $(CFLAGS) $(DYNLDFLAGS) $^ -o $@
$(STATOBJ): $(STATSRC)
$(CC) -c $(CFLAGS) $^ -o $(STATOBJ)
$(STATLIB): $(STATOBJ)
$(AR) $(ARFLAGS) $@ $^
.PHONY: clean all
clean:
rm -rf $(DYNOBJ) $(DYNLIB) $(DYNDBG) \
$(STATOBJ) $(STATLIB) \
$(EXOBJ) $(EXEXE) $(EXDBG) \
$(ASYNC_EXOBJ) $(ASYNC_EXEXE) $(ASYNC_EXDBG) \
$(DATAFILE)