srw / Makefile

# srw - simple read wrapper


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

all: options srw

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

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


srw: ${OBJ}
	@echo CC -o $@
	@${CC} -o $@ ${OBJ} ${LDFLAGS}

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

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

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

	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
	@rm -f ${DESTDIR}${PREFIX}/bin/srw
	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
	@rm -f ${DESTDIR}${MANPREFIX}/man1/srw.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.