spmenu/Makefile

65 lines
1.6 KiB
Makefile
Raw Normal View History

2023-01-20 23:17:30 +01:00
# spmenu
# See LICENSE file for copyright and license details.
include options.mk
include host.mk
include toggle.mk
SRC = draw.c spmenu.c main.c
OBJ = $(SRC:.c=.o)
all: options spmenu
options:
@echo spmenu build options:
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "CC = $(CC)"
.c.o:
$(CC) -c $(CFLAGS) -g $<
$(OBJ): options.h options.mk draw.h
2023-01-20 23:17:30 +01:00
spmenu: spmenu.o draw.o main.o
$(CC) -o $@ spmenu.o draw.o main.o $(LDFLAGS)
clean:
rm -f spmenu $(OBJ) spmenu-$(VERSION).tar.gz
dist: clean
mkdir -p spmenu-$(VERSION)
cp -rf LICENSE Makefile *.h *.mk *.c scripts/ docs/ libs/ spmenu-$(VERSION)
2023-01-20 23:17:30 +01:00
tar -cf spmenu-$(VERSION).tar spmenu-$(VERSION)
gzip spmenu-$(VERSION).tar
rm -rf spmenu-$(VERSION)
install: all
mkdir -p $(DESTDIR)$(PREFIX)/bin
2023-01-20 23:28:33 +01:00
cp -rf spmenu scripts/* $(DESTDIR)$(PREFIX)/bin
2023-01-20 23:17:30 +01:00
chmod 755 $(DESTDIR)$(PREFIX)/bin/spmenu*
rm -f *.o
rm -f spmenu
2023-02-10 16:57:20 +01:00
rm -f a.out
2023-01-20 23:17:30 +01:00
2023-02-01 21:48:52 +01:00
compat:
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu
rm -f $(DESTDIR)$(PREFIX)/bin/dmenu_run
ln -s $(DESTDIR)$(PREFIX)/bin/spmenu $(DESTDIR)$(PREFIX)/bin/dmenu
ln -s $(DESTDIR)$(PREFIX)/bin/spmenu_run $(DESTDIR)$(PREFIX)/bin/dmenu_run
2023-01-20 23:17:30 +01:00
uninstall:
$(DESTDIR)$(PREFIX)/bin/spmenu*\
help:
@echo install: Installs spmenu. You may need to run this as root.
@echo uninstall: Uninstalls spmenu. You may need to run this as root.
2023-02-01 21:48:52 +01:00
@echo dist: Creates a release for spmenu.
@echo clean: Removes objects and tarballs.
@echo compat: Installs compatibility with dmenu. WARNING: This will overwrite dmenu and dmenu_run
2023-01-20 23:17:30 +01:00
@echo help: Displays this help sheet.
.PHONY: all options clean dist install uninstall help