Skip to content

Commit

Permalink
Makefiles: simplify rules with pkg-config call
Browse files Browse the repository at this point in the history
  • Loading branch information
Apaczer committed Aug 12, 2024
1 parent d823445 commit 32c3c49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ STRIP := $(CROSS_COMPILE)strip

SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
FREETYPE_LIBS := $(shell $(SYSROOT)/usr/bin/freetype-config --libs)
PKG_LIBS := $(shell $(CHAINPREFIX)/usr/bin/pkg-config --libs sdl SDL_image SDL_ttf)

CFLAGS = -DPLATFORM=\"$(PLATFORM)\" $(GMENU2X_HASH) -DLOG_LEVEL=4
CFLAGS += -O0 -ggdb -g -pg $(SDL_CFLAGS)
Expand All @@ -20,7 +19,7 @@ CFLAGS += -Isrc -Isrc/libopk
CFLAGS += -DTARGET_LINUX -DHW_TVOUT -DHW_UDC -DHW_EXT_SD -DHW_SCALER -DOPK_SUPPORT -DIPK_SUPPORT

LDFLAGS = -Wl,-Bstatic -Lsrc/libopk -l:libopk.a
LDFLAGS += -Wl,-Bdynamic -lz $(SDL_LIBS) -lSDL_image -lSDL_ttf -ltiff $(FREETYPE_LIBS) -ljpeg -lwebp
LDFLAGS += -Wl,-Bdynamic -lz $(PKG_LIBS)

OBJDIR = /tmp/gmenu2x/$(PLATFORM)
DISTDIR = dist/$(PLATFORM)
Expand Down
5 changes: 2 additions & 3 deletions Makefile.miyoo
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ STRIP := $(CROSS_COMPILE)strip

SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
FREETYPE_LIBS := $(shell $(SYSROOT)/usr/bin/freetype-config --libs)
PKG_LIBS := $(shell $(SYSROOT)/../../pkg-config --libs sdl SDL_image SDL_ttf)

CFLAGS = -DPLATFORM=\"$(PLATFORM)\" -DLOG_LEVEL=3 $(GMENU2X_HASH)
CFLAGS += -Isrc
# Zero optimization flag due to unexpected behavior on 2022 clibs
CFLAGS += -O0 -ggdb -g3 $(SDL_CFLAGS)
CFLAGS += -DTARGET_MIYOO -DHW_LIDVOL -DIPK_SUPPORT

LDFLAGS = $(SDL_LIBS) -lSDL_image -lSDL_ttf -ltiff $(FREETYPE_LIBS) -ljpeg -lwebp
LDFLAGS = $(PKG_LIBS)

OBJDIR = /tmp/gmenu2x/$(PLATFORM)
DISTDIR = dist/$(PLATFORM)
Expand Down

0 comments on commit 32c3c49

Please sign in to comment.