Skip to content

Commit

Permalink
Move unix specific build rules
Browse files Browse the repository at this point in the history
  • Loading branch information
amirgon committed Jun 16, 2023
1 parent 808d72d commit c8299de
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 37 deletions.
37 changes: 0 additions & 37 deletions extmod/extmod.mk
Original file line number Diff line number Diff line change
Expand Up @@ -368,43 +368,6 @@ endif
endif

################################################################################
# LVGL

# Additional optional libraries

ifneq ($(UNAME_S),Darwin)
CFLAGS_EXTMOD += -DMICROPY_FB=1
endif

SDL_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags sdl2)
SDL_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs sdl2)
ifneq ($(SDL_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(SDL_CFLAGS_EXTMOD) -DMICROPY_SDL=1
LDFLAGS_EXTMOD += $(SDL_LDFLAGS_EXTMOD)
endif

RLOTTIE_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags rlottie)
RLOTTIE_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs rlottie)
ifneq ($(RLOTTIE_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(RLOTTIE_CFLAGS_EXTMOD) -DMICROPY_RLOTTIE=1
LDFLAGS_EXTMOD += $(RLOTTIE_LDFLAGS_EXTMOD)
endif

FREETYPE_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags freetype2)
FREETYPE_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs freetype2)
ifneq ($(FREETYPE_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(FREETYPE_CFLAGS_EXTMOD) -DMICROPY_FREETYPE=1
LDFLAGS_EXTMOD += $(FREETYPE_LDFLAGS_EXTMOD)
endif

FFMPEG_LIBS := libavformat libavcodec libswscale libavutil
FFMPEG_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags $(FFMPEG_LIBS))
FFMPEG_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs $(FFMPEG_LIBS))
ifneq ($(FFMPEG_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(FFMPEG_CFLAGS_EXTMOD) -DMICROPY_FFMPEG=1
LDFLAGS_EXTMOD += $(FFMPEG_LDFLAGS_EXTMOD)
endif

# LVGL build rules

LVGL_BINDING_DIR = $(TOP)/lib/lv_bindings
Expand Down
40 changes: 40 additions & 0 deletions ports/unix/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,46 @@ ifeq ($(MICROPY_PY_JNI),1)
CFLAGS += -I/usr/lib/jvm/java-7-openjdk-amd64/include -DMICROPY_PY_JNI=1
endif

################################################################################
# LVGL unix optional libraries
# Update CFLAGS_EXTMOD and LDFLAGS_EXTMOD for LVGL extenral library,
# but do that only on the unix port, for unix specific dependencies

ifneq ($(UNAME_S),Darwin)
CFLAGS_EXTMOD += -DMICROPY_FB=1
endif

SDL_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags sdl2)
SDL_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs sdl2)
ifneq ($(SDL_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(SDL_CFLAGS_EXTMOD) -DMICROPY_SDL=1
LDFLAGS_EXTMOD += $(SDL_LDFLAGS_EXTMOD)
endif

RLOTTIE_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags rlottie)
RLOTTIE_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs rlottie)
ifneq ($(RLOTTIE_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(RLOTTIE_CFLAGS_EXTMOD) -DMICROPY_RLOTTIE=1
LDFLAGS_EXTMOD += $(RLOTTIE_LDFLAGS_EXTMOD)
endif

FREETYPE_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags freetype2)
FREETYPE_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs freetype2)
ifneq ($(FREETYPE_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(FREETYPE_CFLAGS_EXTMOD) -DMICROPY_FREETYPE=1
LDFLAGS_EXTMOD += $(FREETYPE_LDFLAGS_EXTMOD)
endif

FFMPEG_LIBS := libavformat libavcodec libswscale libavutil
FFMPEG_CFLAGS_EXTMOD := $(shell pkg-config --silence-errors --cflags $(FFMPEG_LIBS))
FFMPEG_LDFLAGS_EXTMOD := $(shell pkg-config --silence-errors --libs $(FFMPEG_LIBS))
ifneq ($(FFMPEG_LDFLAGS_EXTMOD),)
CFLAGS_EXTMOD += $(FFMPEG_CFLAGS_EXTMOD) -DMICROPY_FFMPEG=1
LDFLAGS_EXTMOD += $(FFMPEG_LDFLAGS_EXTMOD)
endif

################################################################################

# source files
SRC_C += \
main.c \
Expand Down

0 comments on commit c8299de

Please sign in to comment.