Compare commits

..

6 Commits

Author SHA1 Message Date
8443d786e5 fix: use cc as linker as well, since it seems that there are a few issues with it. 2025-09-15 11:24:56 +02:00
f205a0e9aa fix: shader hex code is formatted incorrectly 2025-09-15 11:24:24 +02:00
03daaf86e8 fix: colour coding on error messages is incorrect 2025-09-15 11:24:24 +02:00
af9ae6d4f2 fix: using the linker for generating a .o file is a feature for only GNU ld.
Now utilising a process to generate a .c file using `xxd`, and compiling
those to object files.
2025-09-15 11:24:24 +02:00
0c59b3066b fix: use more accurate linker flags / calling. 2025-09-15 11:24:24 +02:00
7677c7e047 add runner architecture to the action cache 2025-09-15 11:15:06 +02:00
2 changed files with 9 additions and 14 deletions

View File

@@ -25,13 +25,12 @@ jobs:
if: runner.os == 'Linux' if: runner.os == 'Linux'
run: | run: |
sudo apt update sudo apt update
sudo apt install -y libwayland-dev libxkbcommon-dev xorg-dev cmake xxd sudo apt install -y libwayland-dev libxkbcommon-dev xorg-dev cmake
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: lib/obj/ path: lib/obj/
# I swear to god, if runner.arch displays x64 for x86_64, I will eat a potato. # I swear to god, if runner.arch displays x64 for x86_64, I will eat a potato.
# note: it is... fucking shit.
key: ${{runner.os}}_${{runner.arch}}-lib/obj-${{github.sha}} key: ${{runner.os}}_${{runner.arch}}-lib/obj-${{github.sha}}
restore-keys: ${{runner.os}}_${{runner.arch}}-lib/obj- restore-keys: ${{runner.os}}_${{runner.arch}}-lib/obj-
- run: make -Bj libs - run: make -Bj libs

View File

@@ -5,6 +5,7 @@
NAME = mcaselector-lite NAME = mcaselector-lite
DEBUG ?= 0 DEBUG ?= 0
CC ?= cc CC ?= cc
LD ?= cc
# setting default compilation flags # setting default compilation flags
# some of which are able to be overwritten, others are always appended # some of which are able to be overwritten, others are always appended
@@ -48,16 +49,11 @@ all: bin/$(NAME)
libs: lib/obj/glfw/ lib/obj/libarchive/ libs: lib/obj/glfw/ lib/obj/libarchive/
test: bin/TEST_$(NAME); bin/TEST_$(NAME) test: bin/TEST_$(NAME); bin/TEST_$(NAME)
clean: clean:
ifneq ($(wildcard bin/),) @[ -d bin/ ] && rm -vr bin/ || true
rm -vr bin/ @[ -d obj/ ] && rm -vr obj/ || true
endif
ifneq ($(wildcard obj/),)
rm -vr obj/
endif
clean-libs: clean-libs:
ifneq ($(wildcard lib/obj/),) @[ -d lib/obj/ ] && rm -vr lib/obj/ || true
rm -vr lib/obj/
endif
# compiles the libraries using cmake # compiles the libraries using cmake
lib/obj/%/: lib/%/ lib/obj/%/: lib/%/
@@ -68,18 +64,18 @@ lib/obj/%/: lib/%/
bin/$(NAME): $(OBJ) bin/$(NAME): $(OBJ)
$(info [LD] $@) $(info [LD] $@)
@mkdir -p $(@D) @mkdir -p $(@D)
@$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS) @$(LD) -o $@ $^ $(LDFLAGS) $(LDLIBS)
# link together a testing binary # link together a testing binary
bin/TEST_$(NAME): $(TOBJ) $(filter-out obj/src/main.o,$(OBJ)) bin/TEST_$(NAME): $(TOBJ) $(filter-out obj/src/main.o,$(OBJ))
$(info [LD] $@) $(info [LD] $@)
@mkdir -p $(@D) @mkdir -p $(@D)
@$(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS) @$(LD) -o $@ $^ $(LDFLAGS) $(LDLIBS)
obj/res/%.c: res/% obj/res/%.c: res/%
$(info [XXD] $@) $(info [XXD] $@)
@mkdir -p $(@D) @mkdir -p $(@D)
@cd res/ && xxd -i $(patsubst res/%,%,$<) $(abspath $@) @xxd -i -n $(patsubst res/%,%,$<) $< $@
obj/res/%.o: obj/res/%.c obj/res/%.o: obj/res/%.c
$(info [CC] $@) $(info [CC] $@)