-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
56 lines (40 loc) · 1.24 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
#
# Makefile for "HelioLinc Advanced"
#
# To build all programs (in parallel), run: make -j4
# To install to ../bin, run: sudo make install
# To install to (say) /usr/local, run: PREFIX=/usr/local make install
#
PREFIX ?= ..
CXXFLAGS ?= -O3
###
PROGRAMS_PATH = $(PREFIX)/bin
PROGRAMS = heliolinc make_tracklets link_refine link_refine_multisite link_refine_Herget cluster2mpc80a pair2mpc80
LIB = libhela.a
LIB_SOURCES = solarsyst_dyn_geo01.cpp
SOURCES = $(LIB_SOURCES) $(PROGRAMS:%=%.cpp)
.PHONY: all
all: $(PROGRAMS)
.PHONY: install
install: $(PROGRAMS)
mkdir -p $(PREFIX)/bin
cp -p $(PROGRAMS) $(PREFIX)/bin
$(PROGRAMS): %: %.o $(LIB)
$(CXX) $< -L. -lhela $(OUTPUT_OPTION)
$(LIB): $(LIB_SOURCES:%.cpp=%.o)
$(AR) -rc $@ $^
clean:
rm -f $(PROGRAMS) $(LIB) $(SOURCES:%.cpp=%.o)
rm -rf .deps
###
DEPDIR := .deps
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td
POSTCOMPILE = mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d && touch $@
%.o : %.cpp
%.o : %.cpp $(DEPDIR)/%.d | $(DEPDIR)
$(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -std=c++11 -I../include -c $(OUTPUT_OPTION) $<
@ $(POSTCOMPILE)
$(DEPDIR): ; @mkdir -p $@
DEPFILES := $(SOURCES:%.cpp=$(DEPDIR)/%.d)
$(DEPFILES):
include $(wildcard $(DEPFILES))