Help: add "official" include subdir in Makefile

support for the powerpc toolchain
Post Reply
nebiun
Posts: 49
Joined: Sat Dec 28, 2013 2:42 pm

Help: add "official" include subdir in Makefile

Post by nebiun » Thu Feb 14, 2019 5:50 pm

Hi,
to resolve
#include <ft2build.h>
this code is correct or there is a *best* solution?

Code: Select all

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
INCLUDEDIR := $(foreach dir,$(LIBDIRS),$(dir $(wildcard $(dir)/include/*/)))	<------- discover include directories
export INCLUDE	:=	$(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
					$(foreach dir,$(INCLUDEDIR),-I$(dir)) \		<------- add to include list
					-I$(CURDIR)/include \
					-I$(CURDIR)/$(BUILD) \
					-I$(LIBOGC_INC)

WinterMute
Site Admin
Posts: 1403
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Help: add "official" include subdir in Makefile

Post by WinterMute » Thu Feb 14, 2019 8:09 pm

Use freetype-config like this.

Code: Select all

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS	= -g -O2 -Wall $(MACHDEP) $(INCLUDE) `freetype-config --cflags`  <------- add include directories
CXXFLAGS	=	$(CFLAGS)

LDFLAGS	=	-g $(MACHDEP) -Wl,-Map,$(notdir [email protected]).map

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS	:=	`freetype-config --libs` -lwiiuse -lbte -logc -lm       <------- add lib directories & libs

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS	:= $(PORTLIBS)     <------- add portlibs
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

nebiun
Posts: 49
Joined: Sat Dec 28, 2013 2:42 pm

Re: Help: add "official" include subdir in Makefile

Post by nebiun » Fri Feb 15, 2019 9:01 am

Thankyou!
There is wiki or faq page for tricks like this?

WinterMute
Site Admin
Posts: 1403
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Help: add "official" include subdir in Makefile

Post by WinterMute » Wed Feb 20, 2019 6:33 pm

This isn't really a trick as such, it's just how you're supposed to use freetype. I've updated the wiki portlibs page with some useful info, hopefully that helps.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest