Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@

# use GNU C++ compiler by default
#
# can be overridden with CPP parameter
#
# e.g. make CPP=clang will use clang instead of g++
# (note uppercase 'CPP' and no whitespace around '=')

CPP := g++

# Build configuration: DOCKER_BUILD=1 for Docker, otherwise local
Expand Down Expand Up @@ -58,10 +50,10 @@ BOOSTLIBS := -lboost_filesystem -lboost_program_options -lboost_system
HDF5LIBS := -lhdf5_hl_cpp -lhdf5_cpp -lhdf5_hl -lhdf5
LFLAGS := -L$(GSLLIBDIR) -L$(BOOSTLIBDIR) -L$(HDF5LIBDIR) -Xlinker -rpath -Xlinker $(BOOSTLIBDIR) $(HDF5LIBS) $(LIBS) $(GSLLIBS) $(BOOSTLIBS) $(LFLAGS_SPECIFIC)

.PHONY: all static fast staticfast clean
.PHONY: all static fast staticfast clean link

# Main targets
all: $(EXE)
all: $(EXE) link

static: $(EXE)_STATIC

Expand All @@ -77,6 +69,10 @@ $(EXE)_STATIC: $(OBJS)
@mkdir -p $(BDIR)
$(CPP) $(OBJS) $(LFLAGS) -static -o $@

# Create a symbolic link for backward compatibility
link: $(EXE)
@ln -sf $(EXE) COMPAS

# Pattern rule to compile source files into object files
$(ODIR)/%.o: %.cpp
@mkdir -p $(ODIR)
Expand All @@ -85,4 +81,4 @@ $(ODIR)/%.o: %.cpp
# Clean-up rule
clean:
@echo "Removing generated files..."
@rm -rf $(ODIR) $(BDIR)
@rm -rf $(ODIR) $(BDIR) COMPAS