aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile58
-rw-r--r--config.mk16
2 files changed, 33 insertions, 41 deletions
diff --git a/Makefile b/Makefile
index d8595fe..f5b84a0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,63 +1,55 @@
1# st - simple terminal 1# st - simple terminal
2# See LICENSE file for copyright and license details. 2# See LICENSE file for copyright and license details.
3.POSIX:
3 4
4include config.mk 5include config.mk
5 6
6SRC = st.c x.c 7SRC = st.c x.c
7OBJ = ${SRC:.c=.o} 8OBJ = $(SRC:.c=.o)
8 9
9all: options st 10all: options st
10 11
11options: 12options:
12 @echo st build options: 13 @echo st build options:
13 @echo "CFLAGS = ${CFLAGS}" 14 @echo "CFLAGS = $(CFLAGS)"
14 @echo "LDFLAGS = ${LDFLAGS}" 15 @echo "LDFLAGS = $(LDFLAGS)"
15 @echo "CC = ${CC}" 16 @echo "CC = $(CC)"
16 17
17config.h: 18config.h:
18 cp config.def.h config.h 19 cp config.def.h config.h
19 20
20.c.o: 21.c.o:
21 @echo CC $< 22 $(CC) $(CFLAGS) -c $<
22 @${CC} -c ${CFLAGS} $<
23 23
24st.o: config.h st.h win.h 24st.o: config.h st.h win.h
25x.o: arg.h st.h win.h 25x.o: arg.h st.h win.h
26 26
27${OBJ}: config.h config.mk 27$(OBJ): config.h config.mk
28 28
29st: ${OBJ} 29st: $(OBJ)
30 @echo CC -o $@ 30 $(CC) $(LDFLAGS) -o $@ $(OBJ)
31 @${CC} -o $@ ${OBJ} ${LDFLAGS}
32 31
33clean: 32clean:
34 @echo cleaning 33 rm -f st $(OBJ) st-$(VERSION).tar.gz
35 @rm -f st ${OBJ} st-${VERSION}.tar.gz
36 34
37dist: clean 35dist: clean
38 @echo creating dist tarball 36 mkdir -p st-$(VERSION)
39 @mkdir -p st-${VERSION} 37 cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 arg.h $(SRC) st-$(VERSION)
40 @cp -R LICENSE Makefile README config.mk config.def.h st.info st.1 arg.h ${SRC} st-${VERSION} 38 tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
41 @tar -cf st-${VERSION}.tar st-${VERSION} 39 rm -rf st-$(VERSION)
42 @gzip st-${VERSION}.tar 40
43 @rm -rf st-${VERSION} 41install: st
44 42 mkdir -p $(DESTDIR)$(PREFIX)/bin
45install: all 43 cp -f st $(DESTDIR)$(PREFIX)/bin
46 @echo installing executable file to ${DESTDIR}${PREFIX}/bin 44 chmod 755 $(DESTDIR)$(PREFIX)/bin/st
47 @mkdir -p ${DESTDIR}${PREFIX}/bin 45 mkdir -p $(DESTDIR)$(MANPREFIX)/man1
48 @cp -f st ${DESTDIR}${PREFIX}/bin 46 sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
49 @chmod 755 ${DESTDIR}${PREFIX}/bin/st 47 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
50 @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 48 tic -sx st.info
51 @mkdir -p ${DESTDIR}${MANPREFIX}/man1
52 @sed "s/VERSION/${VERSION}/g" < st.1 > ${DESTDIR}${MANPREFIX}/man1/st.1
53 @chmod 644 ${DESTDIR}${MANPREFIX}/man1/st.1
54 @echo Please see the README file regarding the terminfo entry of st. 49 @echo Please see the README file regarding the terminfo entry of st.
55 @tic -sx st.info
56 50
57uninstall: 51uninstall:
58 @echo removing executable file from ${DESTDIR}${PREFIX}/bin 52 rm -f $(DESTDIR)$(PREFIX)/bin/st
59 @rm -f ${DESTDIR}${PREFIX}/bin/st 53 rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
60 @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
61 @rm -f ${DESTDIR}${MANPREFIX}/man1/st.1
62 54
63.PHONY: all options clean dist install uninstall 55.PHONY: all options clean dist install uninstall
diff --git a/config.mk b/config.mk
index c84c5ee..527a64d 100644
--- a/config.mk
+++ b/config.mk
@@ -5,24 +5,24 @@ VERSION = 0.7
5 5
6# paths 6# paths
7PREFIX = /usr/local 7PREFIX = /usr/local
8MANPREFIX = ${PREFIX}/share/man 8MANPREFIX = $(PREFIX)/share/man
9 9
10X11INC = /usr/X11R6/include 10X11INC = /usr/X11R6/include
11X11LIB = /usr/X11R6/lib 11X11LIB = /usr/X11R6/lib
12 12
13# includes and libs 13# includes and libs
14INCS = -I. -I/usr/include -I${X11INC} \ 14INCS = -I$(X11INC) \
15 `pkg-config --cflags fontconfig` \ 15 `pkg-config --cflags fontconfig` \
16 `pkg-config --cflags freetype2` 16 `pkg-config --cflags freetype2`
17LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXft \ 17LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft \
18 `pkg-config --libs fontconfig` \ 18 `pkg-config --libs fontconfig` \
19 `pkg-config --libs freetype2` 19 `pkg-config --libs freetype2`
20 20
21# flags 21# flags
22CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 22CPPFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=600
23CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS} 23CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os $(INCS) $(CPPFLAGS)
24LDFLAGS += -g ${LIBS} 24LDFLAGS = -g $(LIBS)
25 25
26# compiler and linker 26# compiler and linker
27# CC = cc 27# CC = c99
28 28