From c9bed3541401d78e5e0a3673a138f81ba66023fc Mon Sep 17 00:00:00 2001 From: Welpyes Date: Thu, 25 Sep 2025 12:29:36 +0800 Subject: yeah --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c283518..b80f809 100644 --- a/Makefile +++ b/Makefile @@ -34,12 +34,17 @@ LDFLAGS ?= -Wl,-O1 -pie # libraries LDLIBS ?= -lX11 -lXinerama -lXcursor -# prefer pkg-confgi +# prefer pkg-config ifneq ($(shell $(PKG_CONFIG) --exists x11 xinerama xcursor && echo yes),) CPPFLAGS += $(shell $(PKG_CONFIG) --cflags x11 xinerama xcursor) LDLIBS := $(shell $(PKG_CONFIG) --libs x11 xinerama xcursor) endif +# Termux detection for libandroid-wordexp +ifneq ($(shell if [ "$$PREFIX" = "/data/data/com.termux/files/usr" ]; then echo yes; fi),) +LDLIBS += -landroid-wordexp +endif + .PHONY: all clean install uninstall clangd .SUFFIXES: -- cgit v1.2.3 From dc2058128e3f4420db2dd4067e11d30d999c7539 Mon Sep 17 00:00:00 2001 From: Welpyes Date: Thu, 25 Sep 2025 12:34:01 +0800 Subject: Added Termux build instructions --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b80f809..b0e1e87 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ CPPFLAGS += $(shell $(PKG_CONFIG) --cflags x11 xinerama xcursor) LDLIBS := $(shell $(PKG_CONFIG) --libs x11 xinerama xcursor) endif -# Termux detection for libandroid-wordexp +# Termux detection for dependency ifneq ($(shell if [ "$$PREFIX" = "/data/data/com.termux/files/usr" ]; then echo yes; fi),) LDLIBS += -landroid-wordexp endif -- cgit v1.2.3 From 4fd455386117a928499337125cce2b127c135e8d Mon Sep 17 00:00:00 2001 From: "Welpyes (Robertson D. Torres)" <110968684+Welpyes@users.noreply.github.com> Date: Sat, 27 Sep 2025 16:28:41 +0800 Subject: Delete Makefile --- Makefile | 96 ---------------------------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile deleted file mode 100644 index b0e1e87..0000000 --- a/Makefile +++ /dev/null @@ -1,96 +0,0 @@ -# tools -CC ?= cc -PKG_CONFIG ?= pkg-config - -# install dirs -PREFIX ?= /usr/local -DESTDIR ?= -BIN := sxwm -MAN := sxwm.1 -MAN_DIR := $(PREFIX)/share/man/man1 -XSESSIONS := $(DESTDIR)$(PREFIX)/share/xsessions - -# layout -SRC_DIR := src/ -OBJ_DIR := build/ -SRC := $(wildcard $(SRC_DIR)/*.c) -OBJ := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRC)) -DEP := $(OBJ:.o=.d) - -# flags -CPPFLAGS ?= -Isrc -D_FORTIFY_SOURCE=2 - -# compile flags + warnings, hardening -CFLAGS ?= -std=c99 -Os -pipe \ - -Wall -Wextra -Wformat=2 -Werror=format-security \ - -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings \ - -Wmissing-prototypes -Wstrict-prototypes -Wswitch-enum \ - -Wundef -Wvla -fno-common -fno-strict-aliasing \ - -fstack-protector-strong -fPIE - -# linker -LDFLAGS ?= -Wl,-O1 -pie - -# libraries -LDLIBS ?= -lX11 -lXinerama -lXcursor - -# prefer pkg-config -ifneq ($(shell $(PKG_CONFIG) --exists x11 xinerama xcursor && echo yes),) -CPPFLAGS += $(shell $(PKG_CONFIG) --cflags x11 xinerama xcursor) -LDLIBS := $(shell $(PKG_CONFIG) --libs x11 xinerama xcursor) -endif - -# Termux detection for dependency -ifneq ($(shell if [ "$$PREFIX" = "/data/data/com.termux/files/usr" ]; then echo yes; fi),) -LDLIBS += -landroid-wordexp -endif - -.PHONY: all clean install uninstall clangd -.SUFFIXES: - -all: $(BIN) - -$(BIN): $(OBJ) - $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) - -$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR) - @mkdir -p $(dir $@) - $(CC) $(CPPFLAGS) $(CFLAGS) -MMD -MP -c -o $@ $< - --include $(DEP) - -$(OBJ_DIR): - @mkdir -p $@ - -clean: - @rm -rf $(OBJ_DIR) $(BIN) - -install: all - @echo "installing $(BIN) to $(DESTDIR)$(PREFIX)/bin..." - @mkdir -p "$(DESTDIR)$(PREFIX)/bin" - @install -m 755 $(BIN) "$(DESTDIR)$(PREFIX)/bin/$(BIN)" - @echo "installing sxwm.desktop to $(XSESSIONS)..." - @mkdir -p "$(XSESSIONS)" - @install -m 644 sxwm.desktop "$(XSESSIONS)/sxwm.desktop" - @echo "installing man page to $(DESTDIR)$(MAN_DIR)..." - @mkdir -p "$(DESTDIR)$(MAN_DIR)" - @install -m 644 $(MAN) "$(DESTDIR)$(MAN_DIR)/" - @echo "copying default config to $(DESTDIR)$(PREFIX)/share/sxwmrc..." - @mkdir -p "$(DESTDIR)$(PREFIX)/share" - @install -m 644 default_sxwmrc "$(DESTDIR)$(PREFIX)/share/sxwmrc" - @echo "installation complete :)" - -uninstall: - @echo "uninstalling $(BIN) from $(DESTDIR)$(PREFIX)/bin..." - @rm -f "$(DESTDIR)$(PREFIX)/bin/$(BIN)" - @echo "uninstalling sxwm.desktop from $(XSESSIONS)..." - @rm -f "$(XSESSIONS)/sxwm.desktop" - @echo "uninstalling man page from $(DESTDIR)$(MAN_DIR)..." - @rm -f "$(DESTDIR)$(MAN_DIR)/$(MAN)" - @echo "uninstallation complete :)" - -# dev tools -clangd: - @echo "generating compile_flags.txt" - @rm -f compile_flags.txt - @for flag in $(CPPFLAGS) $(CFLAGS); do echo $$flag >> compile_flags.txt; done -- cgit v1.2.3