aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSam Chudnick <sam@chudnick.com>2023-02-16 20:53:20 -0500
committerSam Chudnick <sam@chudnick.com>2023-02-16 20:53:20 -0500
commit07109bb861018f4de7785c082262c1e0ff3fede0 (patch)
treed4e90ebfb6aa88006afb978658add050a9cdbdce /Makefile
initial commitHEADmaster
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile69
1 files changed, 69 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f9a5d9e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,69 @@
1.POSIX:
2
3NAME = tabbed
4VERSION = 0.7
5
6# paths
7PREFIX = /usr/local
8MANPREFIX = ${PREFIX}/share/man
9DOCPREFIX = ${PREFIX}/share/doc/${NAME}
10
11# use system flags.
12TABBED_CFLAGS = -I/usr/X11R6/include -I/usr/include/freetype2 ${CFLAGS}
13TABBED_LDFLAGS = -L/usr/X11R6/lib -lX11 -lfontconfig -lXft -lXrender ${LDFLAGS}
14TABBED_CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE
15
16# OpenBSD (uncomment)
17#TABBED_CFLAGS = -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 ${CFLAGS}
18
19SRC = tabbed.c xembed.c
20OBJ = ${SRC:.c=.o}
21BIN = ${OBJ:.o=}
22MAN1 = ${BIN:=.1}
23HDR = arg.h config.def.h
24DOC = LICENSE README
25
26all: ${BIN}
27
28.c.o:
29 ${CC} -o $@ -c $< ${TABBED_CFLAGS} ${TABBED_CPPFLAGS}
30
31${OBJ}: config.h
32
33config.h:
34 cp config.def.h $@
35
36.o:
37 ${CC} -o $@ $< ${TABBED_LDFLAGS}
38
39clean:
40 rm -f ${BIN} ${OBJ} "${NAME}-${VERSION}.tar.gz"
41
42dist: clean
43 mkdir -p "${NAME}-${VERSION}"
44 cp -fR Makefile ${MAN1} ${DOC} ${HDR} ${SRC} "${NAME}-${VERSION}"
45 tar -cf - "${NAME}-${VERSION}" | gzip -c > "${NAME}-${VERSION}.tar.gz"
46 rm -rf ${NAME}-${VERSION}
47
48install: all
49 # installing executable files.
50 mkdir -p "${DESTDIR}${PREFIX}/bin"
51 cp -f ${BIN} "${DESTDIR}${PREFIX}/bin"
52 for f in ${BIN}; do chmod 755 "${DESTDIR}${PREFIX}/bin/$$f"; done
53 # installing doc files.
54 mkdir -p "${DESTDIR}${DOCPREFIX}"
55 cp -f README "${DESTDIR}${DOCPREFIX}"
56 # installing manual pages for general commands: section 1.
57 mkdir -p "${DESTDIR}${MANPREFIX}/man1"
58 for m in ${MAN1}; do sed "s/VERSION/${VERSION}/g" < $$m > "${DESTDIR}${MANPREFIX}/man1/$$m"; done
59
60uninstall:
61 # removing executable files.
62 for f in ${BIN}; do rm -f "${DESTDIR}${PREFIX}/bin/$$f"; done
63 # removing doc files.
64 rm -f "${DESTDIR}${DOCPREFIX}/README"
65 # removing manual pages.
66 for m in ${MAN1}; do rm -f "${DESTDIR}${MANPREFIX}/man1/$$m"; done
67 -rmdir "${DESTDIR}${DOCPREFIX}"
68
69.PHONY: all clean dist install uninstall