Refactoring Makefile and config.mk to make it easier to enable patches such as the ligatures patch and the sixel patch

This commit is contained in:
bakkeby 2021-05-09 15:06:02 +02:00
parent 1a1d492cd8
commit e139d1fd75
3 changed files with 12 additions and 13 deletions

View File

@ -4,13 +4,6 @@
include config.mk include config.mk
# Uncomment the line below and the hb.o line further down for the ligatures patch
#LIGATURES_C = hb.c
#LIGATURES_H = hb.h
# Uncomment this for the SIXEL patch / SIXEL_PATCH
#SIXEL_C = sixel.c sixel_hls.c
SRC = st.c x.c $(LIGATURES_C) $(SIXEL_C) SRC = st.c x.c $(LIGATURES_C) $(SIXEL_C)
OBJ = $(SRC:.c=.o) OBJ = $(SRC:.c=.o)
@ -33,8 +26,6 @@ patches.h:
st.o: config.h st.h win.h st.o: config.h st.h win.h
x.o: arg.h config.h st.h win.h $(LIGATURES_H) x.o: arg.h config.h st.h win.h $(LIGATURES_H)
# Uncomment the below line for the ligatures patch
#hb.o: st.h
$(OBJ): config.h config.mk patches.h $(OBJ): config.h config.mk patches.h

View File

@ -18,15 +18,24 @@ PKG_CONFIG = pkg-config
# Uncomment this for the themed cursor patch / THEMED_CURSOR_PATCH # Uncomment this for the themed cursor patch / THEMED_CURSOR_PATCH
#XCURSOR = -lXcursor #XCURSOR = -lXcursor
# Uncomment the lines below for the ligatures patch / LIGATURES_PATCH
#LIGATURES_C = hb.c
#LIGATURES_H = hb.h
#LIGATURES_INC = `$(PKG_CONFIG) --cflags harfbuzz`
#LIGATURES_LIBS = `$(PKG_CONFIG) --libs harfbuzz`
# Uncomment this for the SIXEL patch / SIXEL_PATCH
#SIXEL_C = sixel.c sixel_hls.c
# includes and libs, uncomment harfbuzz for the ligatures patch # includes and libs, uncomment harfbuzz for the ligatures patch
INCS = -I$(X11INC) \ INCS = -I$(X11INC) \
`$(PKG_CONFIG) --cflags fontconfig` \ `$(PKG_CONFIG) --cflags fontconfig` \
`$(PKG_CONFIG) --cflags freetype2` \ `$(PKG_CONFIG) --cflags freetype2` \
# `$(PKG_CONFIG) --cflags harfbuzz` $(LIGATURES_INC)
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${XRENDER} ${XCURSOR}\ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft ${XRENDER} ${XCURSOR}\
`$(PKG_CONFIG) --libs fontconfig` \ `$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2` \ `$(PKG_CONFIG) --libs freetype2` \
# `$(PKG_CONFIG) --libs harfbuzz` $(LIGATURES_LIBS)
# flags # flags
STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600

View File

@ -169,9 +169,8 @@
/* This patch adds support for drawing ligatures using the Harfbuzz library to transform /* This patch adds support for drawing ligatures using the Harfbuzz library to transform
* original text of a single line to a list of glyphs with ligatures included. * original text of a single line to a list of glyphs with ligatures included.
* This patch depends on the Harfbuzz library and headers to compile. * This patch depends on the Harfbuzz library and headers to compile.
* You need to uncomment the corresponding line in config.mk to use the harfbuzz library * You need to uncomment the corresponding lines in config.mk to use the harfbuzz library
* when including this patch. * when including this patch.
* You need to uncomment the corresponding lines in Makefile when including this patch.
* https://github.com/cog1to/st-ligatures * https://github.com/cog1to/st-ligatures
* https://st.suckless.org/patches/ligatures/ * https://st.suckless.org/patches/ligatures/
*/ */