From fabd4602b3223666165c76c397644a081b9a97e5 Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Wed, 12 Jul 2017 00:24:51 +0200 Subject: Do not obfuscate what make is doing. Change some styling too while we're at it. --- config.mk | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index c84c5ee..527a64d 100644 --- a/config.mk +++ b/config.mk @@ -5,24 +5,24 @@ VERSION = 0.7 # paths PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man +MANPREFIX = $(PREFIX)/share/man X11INC = /usr/X11R6/include X11LIB = /usr/X11R6/lib # includes and libs -INCS = -I. -I/usr/include -I${X11INC} \ +INCS = -I$(X11INC) \ `pkg-config --cflags fontconfig` \ `pkg-config --cflags freetype2` -LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \ - `pkg-config --libs fontconfig` \ +LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ + `pkg-config --libs fontconfig` \ `pkg-config --libs freetype2` # flags -CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 -CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS} -LDFLAGS += -g ${LIBS} +CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 +CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os $(INCS) $(CPPFLAGS) +LDFLAGS = -g $(LIBS) # compiler and linker -# CC = cc +# CC = c99 -- cgit v1.2.3 From d4928edba0fe2cc63b3bc13fd6dad0bcb875174e Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Wed, 12 Jul 2017 00:26:35 +0200 Subject: Let the user specify C and LD FLAGS --- Makefile | 8 ++++---- config.mk | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'config.mk') diff --git a/Makefile b/Makefile index f5b84a0..128ee9d 100644 --- a/Makefile +++ b/Makefile @@ -11,15 +11,15 @@ all: options st options: @echo st build options: - @echo "CFLAGS = $(CFLAGS)" - @echo "LDFLAGS = $(LDFLAGS)" + @echo "CFLAGS = $(STCFLAGS)" + @echo "LDFLAGS = $(STLDFLAGS)" @echo "CC = $(CC)" config.h: cp config.def.h config.h .c.o: - $(CC) $(CFLAGS) -c $< + $(CC) $(STCFLAGS) -c $< st.o: config.h st.h win.h x.o: arg.h st.h win.h @@ -27,7 +27,7 @@ x.o: arg.h st.h win.h $(OBJ): config.h config.mk st: $(OBJ) - $(CC) $(LDFLAGS) -o $@ $(OBJ) + $(CC) $(STLDFLAGS) -o $@ $(OBJ) clean: rm -f st $(OBJ) st-$(VERSION).tar.gz diff --git a/config.mk b/config.mk index 527a64d..0aceec4 100644 --- a/config.mk +++ b/config.mk @@ -20,8 +20,8 @@ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ # flags CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os $(INCS) $(CPPFLAGS) -LDFLAGS = -g $(LIBS) +STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS) +STLDFLAGS = $(LIBS) $(LDFLAGS) # compiler and linker # CC = c99 -- cgit v1.2.3 From 49a4f91fc5caf4b8b64f2b73a6be506fa06917b9 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 14 Mar 2018 19:50:37 +0100 Subject: bump version to 0.8 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 0aceec4..b2eac10 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.7 +VERSION = 0.8 # Customize below to fit your system -- cgit v1.2.3 From 6f0f2b7ec3713351de274707672fbadb6cc727a2 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 20 Mar 2018 21:29:10 +0100 Subject: bump version to 0.8.1 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index b2eac10..039c42c 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.8 +VERSION = 0.8.1 # Customize below to fit your system -- cgit v1.2.3 From 30ce2cc002585409b36c630512c6ca4db8f88f15 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 25 May 2018 11:59:28 +0200 Subject: Pledge on OpenBSD --- config.mk | 6 ++++++ st.c | 8 ++++++++ 2 files changed, 14 insertions(+) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 039c42c..c7355f1 100644 --- a/config.mk +++ b/config.mk @@ -23,6 +23,12 @@ CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS) STLDFLAGS = $(LIBS) $(LDFLAGS) +# OpenBSD: +#CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE +#LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \ +# `pkg-config --libs fontconfig` \ +# `pkg-config --libs freetype2` + # compiler and linker # CC = c99 diff --git a/st.c b/st.c index 0628707..b9750f2 100644 --- a/st.c +++ b/st.c @@ -28,6 +28,10 @@ #include #endif +#ifndef __OpenBSD__ +#define pledge(a,b) 0 +#endif + /* Arbitrary sizes */ #define UTF_INVALID 0xFFFD #define UTF_SIZ 4 @@ -806,9 +810,13 @@ ttynew(char *line, char *cmd, char *out, char **args) die("ioctl TIOCSCTTY failed: %s\n", strerror(errno)); close(s); close(m); + if (pledge("stdio getpw proc exec", NULL) == -1) + die("pledge\n"); execsh(cmd, args); break; default: + if (pledge("stdio rpath tty proc", NULL) == -1) + die("pledge\n"); close(s); cmdfd = m; signal(SIGCHLD, sigchld); -- cgit v1.2.3 From dc3b5babf1f8639a0d65cd347fc7879ac0461012 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 2 Jun 2018 17:11:14 +0200 Subject: config.mk: remove extra newline before EOF --- config.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index c7355f1..e676105 100644 --- a/config.mk +++ b/config.mk @@ -31,4 +31,3 @@ STLDFLAGS = $(LIBS) $(LDFLAGS) # compiler and linker # CC = c99 - -- cgit v1.2.3 From e23acb9188b7bc7a7cfc418ac45671003abcc341 Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Fri, 4 Jan 2019 09:48:37 +0100 Subject: Set the path of pkg-config in a variable instead of hardcoding it In this way the path of pkg-config can be overridden from the command line. This is useful for example when cross-compiling. --- config.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index e676105..64a1da9 100644 --- a/config.mk +++ b/config.mk @@ -10,13 +10,15 @@ MANPREFIX = $(PREFIX)/share/man X11INC = /usr/X11R6/include X11LIB = /usr/X11R6/lib +PKG_CONFIG = pkg-config + # includes and libs INCS = -I$(X11INC) \ - `pkg-config --cflags fontconfig` \ - `pkg-config --cflags freetype2` + `$(PKG_CONFIG) --cflags fontconfig` \ + `$(PKG_CONFIG) --cflags freetype2` LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ - `pkg-config --libs fontconfig` \ - `pkg-config --libs freetype2` + `$(PKG_CONFIG) --libs fontconfig` \ + `$(PKG_CONFIG) --libs freetype2` # flags CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -- cgit v1.2.3 From 16d98738e74f189b3a00c23390ab5a9a22b056a1 Mon Sep 17 00:00:00 2001 From: Paride Legovini Date: Thu, 10 Jan 2019 13:36:09 +0100 Subject: Let the user specify CPPFLAGS This complements the work done in d4928ed, allowing the user to specify the preprocessor flags with the CPPFLAGS environment variable. This is useful for example to specify preprocessor macros with -D. CFLAGS could be used instead, but CPPFLAGS is more correct and is expected to be honored in some cases. For example, the helper scripts to build Debian packages make use of CPPFLAGS, but the variable is currently being ignored unless manually appended to CFLAGS. --- config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 64a1da9..5059632 100644 --- a/config.mk +++ b/config.mk @@ -21,8 +21,8 @@ LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \ `$(PKG_CONFIG) --libs freetype2` # flags -CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -STCFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS) +STCPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 +STCFLAGS = $(INCS) $(STCPPFLAGS) $(CPPFLAGS) $(CFLAGS) STLDFLAGS = $(LIBS) $(LDFLAGS) # OpenBSD: -- cgit v1.2.3 From 75f92eb3489275bfcad901e5ca424134eda6e2f4 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 9 Feb 2019 12:48:39 +0100 Subject: bump version to 0.8.2 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 5059632..0cbb002 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.8.1 +VERSION = 0.8.2 # Customize below to fit your system -- cgit v1.2.3 From 43a395ae91f7d67ce694e65edeaa7bbc720dd027 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 27 Apr 2020 13:56:25 +0200 Subject: bump version to 0.8.3 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 0cbb002..beafc35 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.8.2 +VERSION = 0.8.3 # Customize below to fit your system -- cgit v1.2.3 From b27a383a3acc7decf00e6e889fca265430b5d329 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 17 Jun 2020 23:47:00 +0200 Subject: config.mk: use PKG_CONFIG in commented OpenBSD section --- config.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index beafc35..7b1c3db 100644 --- a/config.mk +++ b/config.mk @@ -28,8 +28,8 @@ STLDFLAGS = $(LIBS) $(LDFLAGS) # OpenBSD: #CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600 -D_BSD_SOURCE #LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \ -# `pkg-config --libs fontconfig` \ -# `pkg-config --libs freetype2` +# `$(PKG_CONFIG) --libs fontconfig` \ +# `$(PKG_CONFIG) --libs freetype2` # compiler and linker # CC = c99 -- cgit v1.2.3 From fa253f077f19b3220c7655b81bd91e52f4367803 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 19 Jun 2020 11:27:17 +0200 Subject: bump version to 0.8.4 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 7b1c3db..c070a4a 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.8.3 +VERSION = 0.8.4 # Customize below to fit your system -- cgit v1.2.3 From 7fb0c0cc681f36be2ad12091ef93a41671f32738 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 7 Jan 2022 12:39:57 +0100 Subject: bump version to 0.8.5 --- config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config.mk') diff --git a/config.mk b/config.mk index c070a4a..4c4c5d5 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # st version -VERSION = 0.8.4 +VERSION = 0.8.5 # Customize below to fit your system -- cgit v1.2.3 From baa9357e96d2478baa52a3301e70ac80a229b726 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 1 May 2022 18:38:40 +0200 Subject: Makefile: add manual path for OpenBSD --- config.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'config.mk') diff --git a/config.mk b/config.mk index 4c4c5d5..ddf278a 100644 --- a/config.mk +++ b/config.mk @@ -30,6 +30,7 @@ STLDFLAGS = $(LIBS) $(LDFLAGS) #LIBS = -L$(X11LIB) -lm -lX11 -lutil -lXft \ # `$(PKG_CONFIG) --libs fontconfig` \ # `$(PKG_CONFIG) --libs freetype2` +#MANPREFIX = ${PREFIX}/man # compiler and linker # CC = c99 -- cgit v1.2.3