Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - danchoy

Pages: [1]
1
General / makefile running order
« on: November 13, 2022, 03:06:26 am »
Hi, I'm not sure if I'm a weird case.
Here is my case, normally when I run my makefile on Linux I put the variable DEPS under the CFLAGS line without any issues.
I just installed brew and SFML on my macOS then I modified my makefile to set the paths to my local SFML includes and libraries.
Strangely, after I put the path into the makefile and run it, it prompts me with an error saying the SFML/anyfile.hpp file cannot be found.

Finally, I found that if I relocated the variable DEPS below the compile session, it ran it successfully.

Does anyone else have any ideas?

Thanks

CC = g++
lint = cpplint
CFLAGS = --std=c++14 -Wall -Werror -pedantic
SFML_INCLUDE = -I/opt/homebrew/Cellar/sfml/2.5.1_2/include
SFML_LIB = -L/opt/homebrew/Cellar/sfml/2.5.1_2/lib/
BOOST_INCLUDE = -I/opt/homebrew/Cellar/boost/1.80.0/include
BOOST_LIB = -L/opt/homebrew/Cellar/boost/1.80.0/lib/
LIB = -lboost_unit_test_framework -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
LintFlags = --linelength=120 --filter=-build/header_guard,-runtime/references --counting=detailed $$( find . -name \*.hpp -or -name \*.cpp | grep -vE "^\.\/build\/" )

all: sfml-app

%.o: %.cpp $(DEPS)
        $(CC) $(CFLAGS) -c $< $(SFML_INCLUDE) $(BOOST_INCLUDE)
DEPS = header/%.hpp
 

Pages: [1]