Makefile 1.37 KB
Newer Older
Edward Vigmond's avatar
Edward Vigmond committed
1 2
HOSTMACHINE := $(shell uname)

Edward Vigmond's avatar
Edward Vigmond committed
3
HDF5API_ROOT  := ./hdf5api
4

Edward Vigmond's avatar
Edward Vigmond committed
5 6
FLTK_INC      := $(shell fltk-config --use-gl --cxxflags)
FLTK_LD_FLAGS := $(shell fltk-config --use-images --use-gl --ldflags)
7
COMMON_INC    := -I. -O0 -g -DOBJ_CLASS -D_REENTRANT -MMD -DNOMINMAX  -fopenmp
8 9

ifdef HDF5
Edward Vigmond's avatar
Edward Vigmond committed
10
LIB_CH5       := (HDF5_ROOT)/lib/libch5.a
11 12 13 14 15 16
LIB_HDF5      := -lch5 -lhdf5 -lhdf5_hl 
COMMON_INC    += -DUSE_HDF5
else
LIB_CH5       := 
LIB_HDF5      := 
endif
Edward Vigmond's avatar
Edward Vigmond committed
17

18
COMMON_LIBS    = -lpng -lpthread -lm -lz $(LIB_HDF5) 
Edward Vigmond's avatar
Edward Vigmond committed
19 20

LIBS     = -L$(HDF5API_ROOT)/lib $(FLTK_LD_FLAGS) $(COMMON_LIBS)
21
LDFLAGS  =  -fopenmp
22
CXXFLAGS =  -I$(HDF5API_ROOT)/src $(FLTK_INC) $(COMMON_INC)
Edward Vigmond's avatar
Edward Vigmond committed
23

Edward Vigmond's avatar
Edward Vigmond committed
24 25 26 27
CPPFLAGS = $(CFLAGS) -g
ifdef ENABLE_LOGGING
CPPFLAGS += -DLOGGING_ENABLED
endif
Edward Vigmond's avatar
Edward Vigmond committed
28

29 30 31 32 33
FLTK_SOURCES = $(wildcard *.fl)
OBJS = $(FLTK_SOURCES:.fl=.o)\
	$(patsubst %.cc,%.o,$(wildcard *.cc))\
	$(patsubst %.c,%.o,$(wildcard *.c))\
	$(patsubst %.C,%.o,$(wildcard *.C))
34

35
all: meshalyzer
Edward Vigmond's avatar
Edward Vigmond committed
36 37

meshalyzer: $(LIB_CH5) $(FLTK_SOURCES:.fl=.cc) $(OBJS) $(LIB_CH5)
38
	$(CXX) $(LDFLAGS) -o meshalyzer $(sort $(OBJS)) $(LIBS)
Edward Vigmond's avatar
Edward Vigmond committed
39
	fltk-config --post meshalyzer
Edward Vigmond's avatar
Edward Vigmond committed
40

41
ifdef HDF5
Edward Vigmond's avatar
Edward Vigmond committed
42 43
$(LIB_CH5): 
	cd hdf5api && make all
44
endif
Edward Vigmond's avatar
Edward Vigmond committed
45 46

clean:
Edward Vigmond's avatar
Edward Vigmond committed
47 48 49 50
	rm -rf $(FLTK_SOURCES:.fl=.h) $(FLTK_SOURCES:.fl=.cc) *.o *.d meshalyzer meshalyzer.app

utils: 
	cd utils && make all
Edward Vigmond's avatar
Edward Vigmond committed
51

Edward Vigmond's avatar
Edward Vigmond committed
52 53
docs: 
	doxygen Doxyfile
54
ifdef HDF5
Edward Vigmond's avatar
Edward Vigmond committed
55
	cd hdf5api && doxygen Doxyfile
56
endif
57

58 59 60 61
%.h %.cc: %.fl
	fluid -c $<

-include $(OBJS:.o=.d)
Edward Vigmond's avatar
Edward Vigmond committed
62 63 64

.PHONY: utils