(crywl progression) Makefile now uses generic naming, .desktop file is built on demand
This commit is contained in:
parent
f269667a35
commit
39f8e0a52c
3 changed files with 24 additions and 17 deletions
39
Makefile
39
Makefile
|
|
@ -35,10 +35,10 @@ endef
|
||||||
setup:
|
setup:
|
||||||
mkdir -p $(BIN) $(BUILD) $(INCLUDE) $(OBJ)
|
mkdir -p $(BIN) $(BUILD) $(INCLUDE) $(OBJ)
|
||||||
|
|
||||||
all: setup $(call mkbin,dwl)
|
all: setup $(BIN)/$(BINARY) $(BUILD)/$(BINARY).desktop
|
||||||
$(BIN)/dwl: $(call mkobj,dwl.o util.o)
|
$(BIN)/$(BINARY): $(call mkobj,main.o util.o)
|
||||||
$(CC) $^ $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -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 \
|
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)
|
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h)
|
||||||
$(OBJ)/util.o: $(call mksrc,util.c util.h)
|
$(OBJ)/util.o: $(call mksrc,util.c util.h)
|
||||||
|
|
@ -67,31 +67,36 @@ $(INCLUDE)/xdg-shell-protocol.h:
|
||||||
|
|
||||||
$(INCLUDE)/config.h:
|
$(INCLUDE)/config.h:
|
||||||
cp $(SRC)/config.def.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:
|
clean:
|
||||||
rm -rf $(INCLUDE) $(OBJ) $(BUILD) $(BIN)
|
rm -rf $(INCLUDE) $(OBJ) $(BUILD) $(BIN)
|
||||||
|
|
||||||
dist: clean
|
dist: clean $(BUILD)/$(BINARY).desktop
|
||||||
mkdir -p dwl-$(VERSION)
|
mkdir -p $(BINARY)-$(VERSION)
|
||||||
cp -R LICENSE Makefile CHANGELOG.md README.md src \
|
cp -R LICENSE Makefile CHANGELOG.md README.md src \
|
||||||
config.mk protocols dwl.1 dwl.desktop \
|
config.mk protocols dwl.1 $(BUILD)/$(BINARY).desktop \
|
||||||
dwl-$(VERSION)
|
$(BINARY)-$(VERSION)
|
||||||
tar -caf dwl-$(VERSION).tar.gz dwl-$(VERSION)
|
tar -caf $(BINARY)-$(VERSION).tar.gz $(BINARY)-$(VERSION)
|
||||||
rm -rf dwl-$(VERSION)
|
rm -rf $(BINARY)-$(VERSION) $(BUILD)
|
||||||
|
|
||||||
install: $(BIN)/dwl
|
install: $(BIN)/$(BINARY) $(BUILD)/$(BINARY).desktop
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
mkdir -p $(DESTDIR)$(PREFIX)/bin
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY)
|
||||||
cp -f $(BIN)/dwl $(DESTDIR)$(PREFIX)/bin
|
cp -f $(BIN)/$(BINARY) $(DESTDIR)$(PREFIX)/bin
|
||||||
chmod 755 $(DESTDIR)$(PREFIX)/bin/dwl
|
chmod 755 $(DESTDIR)$(PREFIX)/bin/$(BINARY)
|
||||||
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
||||||
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
cp -f dwl.1 $(DESTDIR)$(MANDIR)/man1
|
||||||
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
chmod 644 $(DESTDIR)$(MANDIR)/man1/dwl.1
|
||||||
mkdir -p $(DESTDIR)$(DATADIR)/wayland-sessions
|
mkdir -p $(DESTDIR)$(DATADIR)/wayland-sessions
|
||||||
cp -f dwl.desktop $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
cp -f $(BUILD)/$(BINARY).desktop $(DESTDIR)$(DATADIR)/wayland-sessions/$(BINARY).desktop
|
||||||
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
chmod 644 $(DESTDIR)$(DATADIR)/wayland-sessions/$(BINARY).desktop
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/dwl $(DESTDIR)$(MANDIR)/man1/dwl.1 \
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(BINARY) $(DESTDIR)$(MANDIR)/man1/dwl.1 \
|
||||||
$(DESTDIR)$(DATADIR)/wayland-sessions/dwl.desktop
|
$(DESTDIR)$(DATADIR)/wayland-sessions/$(BINARY).desktop
|
||||||
|
|
||||||
%.c %.o:
|
%.c %.o:
|
||||||
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $<
|
$(CC) $(CPPFLAGS) $(DWLCFLAGS) -o $@ -c $<
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
_VERSION = 0.8-dev
|
_VERSION = 0.8-dev
|
||||||
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
VERSION = `git describe --tags --dirty 2>/dev/null || echo $(_VERSION)`
|
||||||
|
BINARY = crywl
|
||||||
|
DESCRIPTION = "dwm for Wayland"
|
||||||
|
|
||||||
PKG_CONFIG = pkg-config
|
PKG_CONFIG = pkg-config
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue