Hey all,
My main source file and makefile is in one folder. I then have a subdirectory named "Framework" where my Entity/Component framework source is. My questions is, as you can tell from the title, how do I tell the makefile that my source is in that "Framework" subdirectory?
How to tell makefile my source is in a subdirectory?
- BlueCrab
- The Crabby Overlord
- Posts: 5486
- Joined: Mon May 27, 2002 11:31 am
- Location: Sailing the Skies of Arcadia
- Has liked: 4 times
- Been liked: 25 times
- Contact:
Re: How to tell makefile my source is in a subdirectory?
Either specify your source files with the directory as a part of it (so specify them as "Framework/file.c" or whatnot instead of "file.c"), or put a Makefile in your Framework directory to build the source files and make the Makefile in the root directory build the subdirectory (something as simple as this should work):
Code: Select all
all:
$(MAKE) -C Framework
- GyroVorbis
- Elysian Shadows Developer
- Posts: 1808
- Joined: Mon Mar 22, 2004 4:55 pm
- Location: #%^&*!!!11one Super Sonic
- Has liked: 0
- Been liked: 0
- Contact:
Re: How to tell makefile my source is in a subdirectory?
I usually like to create a SRCDIRS variable at the top of my Makefiles with multiple subdirectories:
Then later populate a list of all .c/.cpp files from these directories:
Code: Select all
SRCDIRS:=source components/source
Code: Select all
CPP_SRC:=$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.cpp))
C_SRC:= $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c))
Elysian Shadows - "Next-Gen" 2D/3D RPG coming to Sega Dreamcast, Steam, OUYA, and Smartphones

http://www.elysianshadows.com

http://www.elysianshadows.com