-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
78 lines (57 loc) · 2.07 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
CC = gcc
IDIR := include
SDIR := src
ODIR := obj
BIN := bin
DEMO := demo
# external libs
EXTERNALS_DIR = ./externals
LIBJPEG = $(EXTERNALS_DIR)/libjpeg
LIBPNG = $(EXTERNALS_DIR)/libpng
LIBZ = $(EXTERNALS_DIR)/zlib
INCLUDES = -I$(IDIR) -I$(LIBJPEG)/include -I$(LIBPNG)/include -I$(LIBZ)/include
LIBS = -L$(LIBJPEG)/lib -L$(LIBPNG)/lib -L$(LIBZ)/lib -ljpeg -liftpng -lm -liftz
FLAGS= -O3 -DNDEBUG -Wall -Wno-unused-result -fopenmp -pthread -std=gnu11 -pedantic $(INCLUDES)
#shared includes
_DEPS = iftSuperpixelFeatures.h \
iftExperimentUtility.h \
iftRISF.h \
ift.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
#shared objects
_OBJ = iftSuperpixelFeatures.o \
iftExperimentUtility.o \
iftRISF.o \
ift.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
all: external_libs $(BIN)/iftComputeSegmentationMetrics $(BIN)/iftForceLabelMapConnectivity $(BIN)/iftMidLevelRegionMerge $(BIN)/iftOverlayBorders $(BIN)/iftRISF_segmentation $(BIN)/iftShowConnectivityProblems
########### EXTERNAL LIBS ###########
$(LIBJPEG)/lib/libjpeg.a:
cd $(LIBJPEG); $(MAKE) ; cd -\
$(LIBPNG)/lib/libiftpng.a:
cd $(LIBPNG); $(MAKE) ; cd -\
$(LIBZ)/lib/libiftz.a:
cd $(LIBZ); $(MAKE) ; cd -\
external_libs: $(LIBJPEG)/lib/libjpeg.a $(LIBPNG)/lib/libiftpng.a $(LIBZ)/lib/libiftz.a
$(ODIR)/%.o: $(SDIR)/%.c $(DEPS)
$(CC) $(FLAGS) -c -o $@ $< $(LIBS)
$(BIN)/iftComputeSegmentationMetrics: $(DEMO)/iftComputeSegmentationMetrics.c $(OBJ)
$(CC) $(FLAGS) $^ -o $@ $(LIBS)
$(BIN)/iftForceLabelMapConnectivity: $(DEMO)/iftForceLabelMapConnectivity.c $(OBJ)
$(CC) $(FLAGS) $^ -o $@ $(LIBS)
$(BIN)/iftMidLevelRegionMerge: $(DEMO)/iftMidLevelRegionMerge.c $(OBJ)
$(CC) $(FLAGS) $^ -o $@ $(LIBS)
$(BIN)/iftOverlayBorders: $(DEMO)/iftOverlayBorders.c $(OBJ)
$(CC) $(FLAGS) $^ -o $@ $(LIBS)
$(BIN)/iftRISF_segmentation: $(DEMO)/iftRISF_segmentation.c $(OBJ)
$(CC) $(FLAGS) $^ -o $@ $(LIBS)
$(BIN)/iftShowConnectivityProblems: $(DEMO)/iftShowConnectivityProblems.c $(OBJ)
$(CC) $(FLAGS) $^ -o $@ $(LIBS)
.PHONY: clean
clean:
rm -f $(ODIR)/*.o
rm -df $(ODIR)
rm -f $(BIN)/*;
$(OBJ): | $(ODIR)
$(ODIR):
mkdir $(ODIR)