Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Problem building with original Makefiles #180

Closed
andrewdavidsmith opened this issue May 27, 2021 · 3 comments
Closed

Problem building with original Makefiles #180

andrewdavidsmith opened this issue May 27, 2021 · 3 comments
Assignees
Labels

Comments

@andrewdavidsmith
Copy link
Contributor

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
Copy link
Contributor

terencewtli commented May 27, 2021

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants