-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
41 lines (33 loc) · 887 Bytes
/
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
# This is a makefile!
SRCDIR = src
OBJDIR = obj
BINDIR = bin
DOCDIR = doc
CC = g++
LD = g++
DOCGEN = doxygen
CFLAGS =
CPPFLAGS = -std=c++11 -Wall -pedantic -I$(SRCDIR) -g
ifeq "$(CFLAGS)" "-DNO_GFX"
LDFLAGS = -lm -lsqlite3
else
LDFLAGS = -lm -lGL -lGLU -lglut -lsqlite3 `sdl-config --libs`
endif
DOCGENFLAGS =
COMMON_SRCS = common.cpp error.cpp star.cpp starmap.cpp
GRAPHVIEW_SRCS = graphs.cpp
COMMON_OBJS = $(COMMON_SRCS:.cpp=.o)
GRAPHVIEW_OBJS = $(COMMON_OBJS) $(GRAPHVIEW_SRCS:.cpp=.o)
GRAPHVIEW_BINS = graphview
BINS = $(GRAPHVIEW_BINS)
all : $(BINS)
docs :
$(DOCGEN) $(DOCGENFLAGS)
graphview : $(addprefix $(OBJDIR)/,$(GRAPHVIEW_OBJS))
$(LD) -o $(BINDIR)/$@ $^ $(LDFLAGS)
$(OBJDIR)/%.o : $(SRCDIR)/$(notdir %.cpp) $(SRCDIR)/$(notdir %.hpp)
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
clean:
rm -f $(addprefix $(BINDIR)/,$(BINS)) $(OBJDIR)/*.o
clean-docs:
rm -r $(DOCDIR)/*