
sets_so=sets.o
poutput_so=console.o cp437.o latin1.o pfonts.o poutput.o
poutput_so_libs=$(ICONV_LIBS)

ifeq ($(LINUX),1)
poutput_so+=poutput-vcsa.o poutput-fb.o
endif

ifeq ($(HAVE_CURSES),1)
poutput_so+=poutput-curses.o
poutput_so_libs+=$(NCURSES_LIBS)
endif

ifeq ($(HAVE_X11),1)
poutput_so+=poutput-x11.o x11-common.o
poutput_so_libs+=$(X11_LIBS)
NEED_TTF=1
endif

ifeq ($(HAVE_SDL),1)
poutput_so+=poutput-sdl.o
poutput_so_libs+=$(SDL_LIBS)
NEED_TTF=1
endif

ifeq ($(HAVE_SDL2),1)
poutput_so+=poutput-sdl2.o
poutput_so_libs+=$(SDL2_LIBS)
NEED_TTF=1
endif

ifeq ($(HAVE_SDL3),1)
poutput_so+=poutput-sdl3.o
poutput_so_libs+=$(SDL3_LIBS)
NEED_TTF=1
endif

ifeq ($(NEED_TTF),1)
poutput_so+=ttf.o poutput-swtext.o poutput-fontengine.o
poutput_so_libs+=$(FREETYPE2_LIBS)
endif

# libocp_so is linked by parent
stuff_libocp_so:=compat.o err.o framelock.o poll.o poutput-keyboard.o utf-8.o utf-16.o file.o

ifeq ($(WINDOWS),1)
stuff_libocp_so+=piperun-windows.o
else
stuff_libocp_so+=piperun-unix.o
endif

ifeq ($(STATIC_CORE),1)
 STATIC_OBJECTS += $(patsubst %.o,stuff/%.o,$(sets_so))
 STATIC_OBJECTS += $(patsubst %.o,stuff/%.o,$(poutput_so))
 STATIC_LIBS += $(poutput_so_libs)
endif

LIBOCP_OBJECTS += $(patsubst %.o,stuff/%.o,$(stuff_libocp_so))
