diff --git a/Makefile b/Makefile index c3126b6..d00ada1 100644 --- a/Makefile +++ b/Makefile @@ -35,10 +35,10 @@ endef setup: mkdir -p $(BIN) $(BUILD) $(INCLUDE) $(OBJ) -all: setup $(call mkbin,dwl) -$(BIN)/dwl: $(call mkobj,dwl.o util.o) +all: setup $(BIN)/$(BINARY) $(BUILD)/$(BINARY).desktop +$(BIN)/$(BINARY): $(call mkobj,main.o util.o) $(CC) $^ $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ -$(OBJ)/dwl.o: $(call mksrc,dwl.c client.h) config.mk $(call mkinclude,config.h cursor-shape-v1-protocol.h \ +$(OBJ)/main.o: $(call mksrc,main.c client.h) config.mk $(call mkinclude,config.h cursor-shape-v1-protocol.h \ pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \ wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h) $(OBJ)/util.o: $(call mksrc,util.c util.h) @@ -67,31 +67,36 @@ $(INCLUDE)/xdg-shell-protocol.h: $(INCLUDE)/config.h: cp $(SRC)/config.def.h $@ + +$(BUILD)/$(BINARY).desktop: + mkdir -p $(BUILD) + echo -e "[Desktop Entry]\nName=$(BINARY)\nComment=$(DESCRIPTION)\nExec=$(BINARY)\nType=Application" > $@ + clean: rm -rf $(INCLUDE) $(OBJ) $(BUILD) $(BIN) -dist: clean - mkdir -p dwl-$(VERSION) +dist: clean $(BUILD)/$(BINARY).desktop + mkdir -p $(BINARY)-$(VERSION) cp -R LICENSE Makefile CHANGELOG.md README.md src \ - config.mk protocols dwl.1 dwl.desktop \ - dwl-$(VERSION) - tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION) - rm -rf dwl-$(VERSION) + config.mk protocols dwl.1 $(BUILD)/$(BINARY).desktop \ + $(BINARY)-$(VERSION) + tar -caf $(BINARY)-$(VERSION).tar.gz $(BINARY)-$(VERSION) + rm -rf $(BINARY)-$(VERSION) $(BUILD) -install: $(BIN)/dwl +install: $(BIN)/$(BINARY) $(BUILD)/$(BINARY).desktop mkdir -p $(DESTDIR)$(PREFIX)/bin - rm -f $(DESTDIR)$(PREFIX)/bin/dwl - cp -f $(BIN)/dwl $(DESTDIR)$(PREFIX)/bin - chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl + rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY) + cp -f $(BIN)/$(BINARY) $(DESTDIR)$(PREFIX)/bin + chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BINARY) mkdir -p $(DESTDIR)$(MANDIR)/man1 cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1 chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1 mkdir -p $(DESTDIR)$(DATADIR)/wayland-sessions - cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop - chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop + cp -f $(BUILD)/$(BINARY).desktop $(DESTDIR)$(DATADIR)/wayland-sessions/$(BINARY).desktop + chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/$(BINARY).desktop uninstall: - rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \ - $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop + rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY) $(DESTDIR)$(MANDIR)/man1/dwl.1 \ + $(DESTDIR)$(DATADIR)/wayland-sessions/$(BINARY).desktop %.c %.o: $(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $< diff --git a/config.mk b/config.mk index 7d1dc14..e87cc60 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,7 @@ _VERSION = 0.8-dev VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)` +BINARY = crywl +DESCRIPTION = "dwm for Wayland" PKG_CONFIG = pkg-config diff --git a/src/crywl.c b/src/main.c similarity index 100% rename from src/crywl.c rename to src/main.c