Page 1 of 1

Help: add "official" include subdir in Makefile

Posted: Thu Feb 14, 2019 5:50 pm
by nebiun
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)

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

Posted: Thu Feb 14, 2019 8:09 pm
by WinterMute
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

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

Posted: Fri Feb 15, 2019 9:01 am
by nebiun
Thankyou!
There is wiki or faq page for tricks like this?

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

Posted: Wed Feb 20, 2019 6:33 pm
by WinterMute
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.