diff options
| author | uint <72694427+uint23@users.noreply.github.com> | 2025-09-30 13:42:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-30 13:42:16 +0100 |
| commit | 7022d8c6220953510280335d3f51e91dec015592 (patch) | |
| tree | 87c38dcdf5bcc7385405db783ba15924f8d30caf | |
| parent | 6c8f46da2c3edb191de1850b43fdd0a61ac79240 (diff) | |
| parent | 4fd455386117a928499337125cce2b127c135e8d (diff) | |
Merge pull request #235 from Welpyes/main
Termux Build instructions and Makefile addition
| -rw-r--r-- | Makefile | 91 | ||||
| -rw-r--r-- | README.md | 9 |
2 files changed, 9 insertions, 91 deletions
diff --git a/Makefile b/Makefile deleted file mode 100644 index c283518..0000000 --- a/Makefile +++ /dev/null @@ -1,91 +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-confgi -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 - -.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 @@ -297,6 +297,15 @@ sudo pkg update sudo pkg install gcc gmake libX11 libXinerama</code></pre> </details> +<details> +<summary>Termux</summary> +<pre><code>pkg install x11-repo +pkg update +pkg install clang make xcb-util-keysyms xorgproto libxcursor libx11 libxinerama libandroid-wordexp +# add `LDFLAGS="${LDFLAGS} -landroid-wordexp"` in the make command +</code></pre> +</details> + --- ## Build & Install |
