st

st fork
git clone git://git.rr3.xyz/st
Log | Files | Refs | README | LICENSE

Makefile (1373B)


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