smithlabcode / methpipe

A pipeline for analyzing DNA methylation data from bisulfite sequencing.
http://smithlabresearch.org/methpipe
67 stars 27 forks source link

Problem building with original Makefiles #180

Closed andrewdavidsmith closed 3 years ago

andrewdavidsmith commented 3 years ago

If make is done from a clone of the repo and not using an autotools build, there is no way to pass LDFLAGS, CPPFLAGS, etc., to the make process.

terencewtli commented 3 years ago

I think if we include $(CPPFLAGS) and $(LDFLAGS) in the wildcard expansion lines, it should work. Like this:


 %.o: %.cpp %.hpp
    $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -o $@ $< $(INCLUDEARGS)
 %: %.cpp
    $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(INCLUDEARGS) $(LIBS)
andrewdavidsmith commented 3 years ago

I think there are two parts to this (1) we should be using the appropriate variable names to conform to GNU auto tools stuff, and (2) we need to be able to have them passed in by the users on the make command line.

I think your solution above solves the problem, but we need to be clear on whether they should be entirely overridden by a user or just allow a user to update them (with other things added within the Makefile). We also need to be sure that names like INCLUDEARGS aren't just replacing something more standard within the auto tools framework.

andrewdavidsmith commented 3 years ago

Fixed by using CPPFLAGS, LDFLAGS, and LDLIBS, along with override CPPFLAGS += $(INCLUDEARGS) style for updating these vars from command line.