52 lines
1 KiB
Makefile
52 lines
1 KiB
Makefile
# se - simple editor
|
|
# See LICENSE file for copyright and license details.
|
|
|
|
include config.mk
|
|
|
|
SRC = se.c
|
|
HDR = config.def.h se.h
|
|
OBJ = ${SRC:.c=.o}
|
|
|
|
all: options se
|
|
|
|
options:
|
|
@echo se build options:
|
|
@echo "CFLAGS = ${CFLAGS}"
|
|
@echo "LDFLAGS = ${LDFLAGS}"
|
|
@echo "CC = ${CC}"
|
|
|
|
.c.o:
|
|
${CC} -c ${CFLAGS} $<
|
|
|
|
${OBJ}: config.h config.mk
|
|
|
|
config.h:
|
|
cp config.def.h $@
|
|
|
|
se: ${OBJ}
|
|
${CC} -o $@ ${OBJ} ${LDFLAGS}
|
|
|
|
clean:
|
|
rm -f se ${OBJ} se-${VERSION}.tar.gz
|
|
|
|
dist: clean
|
|
mkdir -p se-${VERSION}
|
|
cp -R LICENSE Makefile README config.mk\
|
|
se.1 ${HDR} ${SRC} se-${VERSION}
|
|
tar -cf se-${VERSION}.tar se-${VERSION}
|
|
gzip se-${VERSION}.tar
|
|
rm -rf se-${VERSION}
|
|
|
|
install: all
|
|
mkdir -p ${DESTDIR}${PREFIX}/bin
|
|
cp -f se ${DESTDIR}${PREFIX}/bin
|
|
chmod 755 ${DESTDIR}${PREFIX}/bin/se
|
|
mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
|
sed "s/VERSION/${VERSION}/g" < se.1 > ${DESTDIR}${MANPREFIX}/man1/se.1
|
|
chmod 644 ${DESTDIR}${MANPREFIX}/man1/se.1
|
|
|
|
uninstall:
|
|
rm -f ${DESTDIR}${PREFIX}/bin/se\
|
|
${DESTDIR}${MANPREFIX}/man1/se.1
|
|
|
|
.PHONY: all options clean dist install uninstall
|