suckless/st

Makefile in master
Repositories | Summary | Log | Files | README | LICENSE

Makefile (1036B) download


 1# st - simple terminal
 2# See LICENSE file for copyright and license details.
 3.POSIX:
 4
 5include config.mk
 6
 7SRC = st.c x.c
 8OBJ = $(SRC:.c=.o)
 9
10all: st
11
12config.h:
13	cp config.def.h config.h
14
15.c.o:
16	$(CC) $(STCFLAGS) -c $<
17
18st.o: config.h st.h win.h
19x.o: arg.h config.h st.h win.h
20
21$(OBJ): config.h config.mk
22
23st: $(OBJ)
24	$(CC) -o $@ $(OBJ) $(STLDFLAGS)
25
26clean:
27	rm -f st $(OBJ) st-$(VERSION).tar.gz
28
29dist: clean
30	mkdir -p st-$(VERSION)
31	cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
32		config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
33		st-$(VERSION)
34	tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
35	rm -rf st-$(VERSION)
36
37install: st
38	mkdir -p $(DESTDIR)$(PREFIX)/bin
39	cp -f st $(DESTDIR)$(PREFIX)/bin
40	chmod 755 $(DESTDIR)$(PREFIX)/bin/st
41	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
42	sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
43	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
44
45uninstall:
46	rm -f $(DESTDIR)$(PREFIX)/bin/st
47	rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
48
49.PHONY: all clean dist install uninstall