From 704ec4107d39022abf76a86982601fd36ff467ff Mon Sep 17 00:00:00 2001 From: Riley Beckett Date: Wed, 8 Oct 2025 21:31:14 -0400 Subject: Inital Commit --- .gitignore | 5 +++++ Makefile | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ main.c | 5 +++++ 3 files changed, 72 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96bdd0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +swenu + +objs/ + +compile_flags.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..300b4ce --- /dev/null +++ b/Makefile @@ -0,0 +1,62 @@ +BIN=swenu +CC=gcc +OBJDIR=objs +LIBS=egl wayland-client gl wayland-egl xkbcommon +CFLAGS=-Wall -g $(shell pkg-config --cflags $(LIBS)) -I$(OBJDIR) +LDFLAGS=$(shell pkg-config --libs $(LIBS)) +VPATH=/usr/share/wayland-protocols/staging/cursor-shape/:/usr/share/wayland-protocols/stable/tablet/:$(OBJDIR) +WLPROT=cursor-shape-v1.xml tablet-v2.xml +WLC=$(patsubst %.xml,$(OBJDIR)/%.c, $(WLPROT)) +WLH=$(patsubst %.xml,$(OBJDIR)/%.h, $(WLPROT)) +SRC=$(WLC) $(wildcard *.c) $(wildcard glad/*.c) +OBJ=$(patsubst %.c,$(OBJDIR)/%.o, $(notdir $(SRC))) + +.SILENT: $(OBJ) $(WLC) $(WLH) $(BIN) $(OBJDIR) compile_flags + +all: $(OBJDIR) $(BIN) + +$(OBJDIR): + [ -d $@ ] || mkdir -p $@ + +$(BIN): $(OBJ) + printf " LD %s\n" $@ + $(CC) $(LDFLAGS) $^ -o $@ + +$(OBJDIR)/%.o: %.c %.h + printf " CC %s\n" $@ + $(CC) $(CFLAGS) -c $< -o $@ + +$(OBJDIR)/%.o: */%.c */%.h + printf " CC %s\n" $@ + $(CC) $(CFLAGS) -c $< -o $@ + +$(OBJDIR)/%.o: %.c + printf " CC %s\n" $@ + $(CC) $(CFLAGS) -c $< -o $@ + +.PRECIOUS: $(OBJDIR)/%.c +$(OBJDIR)/%.c: %.xml $(OBJDIR)/%.h + printf " wayland-scanner %s\n" $@ + wayland-scanner private-code $< $@ + +.PRECIOUS: $(OBJDIR)/%.h +$(OBJDIR)/%.h: %.xml + printf " wayland-scanner %s\n" $@ + wayland-scanner client-header $< $@ + +compile_flags: + echo $(CFLAGS) | tr ' ' '\n' > compile_flags.txt + +clean: + rm -rf $(BIN) $(OBJDIR) + +install: all + install -m 755 ./$(BIN) $(PREFIX)/usr/bin + +uninstall: + rm -rf $(PREFIX)/usr/bin/$(BIN) + +run: all + ./$(BIN) + +.PHONY: all clean run compile_flags install uninstall diff --git a/main.c b/main.c new file mode 100644 index 0000000..11f7c99 --- /dev/null +++ b/main.c @@ -0,0 +1,5 @@ +#include + +int main() { + printf("hello world\n"); +} -- cgit v1.2.3