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

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

ifeq ($(HOSTMACHINE),Darwin)
LIBS =  -L/sw/lib $(FLTK_LD_FLAGS) $(COMMON_LIBS)
CFLAGS = -I/sw/include -I/usr/X11R6/include $(FLTK_INC) $(COMMON_INC)
11
12
13
else
LIBS   = $(FLTK_LD_FLAGS) $(COMMON_LIBS)
CFLAGS = $(FLTK_INC) $(COMMON_INC)
Edward Vigmond's avatar
Edward Vigmond committed
14
15
endif

16
CPPFLAGS = $(CFLAGS)
Edward Vigmond's avatar
Edward Vigmond committed
17

18
19
20
21
22
FLTK_SOURCES = $(wildcard *.fl)
OBJS = $(FLTK_SOURCES:.fl=.o)\
	$(patsubst %.cc,%.o,$(wildcard *.cc))\
	$(patsubst %.c,%.o,$(wildcard *.c))\
	$(patsubst %.C,%.o,$(wildcard *.C))
23

24
meshalyzer: $(FLTK_SOURCES:.fl=.cc) $(OBJS)
25
	$(CXX) $(CFLAGS) -o meshalyzer $(sort $(OBJS)) $(LIBS)
26
ifeq ($(HOSTMACHINE),Darwin)
Edward Vigmond's avatar
Edward Vigmond committed
27
	fltk-config --post meshalyzer
28
endif
Edward Vigmond's avatar
Edward Vigmond committed
29
30

clean:
31
	rm -rf $(FLTK_SOURCES:.fl=.h) $(FLTK_SOURCES:.fl=.cc) *.o *.d meshalyzer
Edward Vigmond's avatar
Edward Vigmond committed
32

33
34
35
utils:
	(cd utils; make )

36
37
38
39
%.h %.cc: %.fl
	fluid -c $<

-include $(OBJS:.o=.d)