slmenu / Makefile

# slmenu - single line menu
# See LICENSE file for copyright and license details.


SRC = slmenu.c
OBJ = ${SRC:.c=.o}

all: options slmenu

	@echo slmenu build options:
	@echo "CFLAGS   = ${CFLAGS}"
	@echo "LDFLAGS  = ${LDFLAGS}"
	@echo "CC       = ${CC}"

	@echo CC -c $<
	@${CC} -c $< ${CFLAGS}


slmenu: slmenu.o
	@echo CC -o $@
	@${CC} -o $@ slmenu.o ${LDFLAGS}

	@echo cleaning
	@rm -f slmenu ${OBJ} slmenu-${VERSION}.tar.gz

dist: clean
	@echo creating dist tarball
	@mkdir -p slmenu-${VERSION}
	@cp LICENSE Makefile README slmenu.1 ${SRC} slmenu-${VERSION}
	@tar -cf slmenu-${VERSION}.tar slmenu-${VERSION}
	@gzip slmenu-${VERSION}.tar
	@rm -rf slmenu-${VERSION}

install: all
	@echo installing executables to ${DESTDIR}${PREFIX}/bin
	@mkdir -p ${DESTDIR}${PREFIX}/bin
	@cp -f slmenu ${DESTDIR}${PREFIX}/bin
	@chmod 755 ${DESTDIR}${PREFIX}/bin/slmenu
	@echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
	@sed "s/VERSION/${VERSION}/g" < slmenu.1 > ${DESTDIR}${MANPREFIX}/man1/slmenu.1
	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/slmenu.1

	@echo removing executables from ${DESTDIR}${PREFIX}/bin
	@rm -f ${DESTDIR}${PREFIX}/bin/slmenu
	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
	@rm -f ${DESTDIR}${MANPREFIX}/man1/slmenu.1

.PHONY: all options clean dist install uninstall
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.