st

git clone git://mattcarlson.org/repos/st.git
Log | Files | Refs

Makefile (1153B)


      1 # st - simple terminal
      2 # See LICENSE file for copyright and license details.
      3 .POSIX:
      4 
      5 include config.mk
      6 
      7 SRC = st.c x.c boxdraw.c hb.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.h:
     19 	cp config.def.h config.h
     20 
     21 .c.o:
     22 	$(CC) $(STCFLAGS) -c $<
     23 
     24 st.o: config.h st.h win.h
     25 x.o: arg.h config.h st.h win.h hb.h
     26 hb.o: st.h
     27 boxdraw.o: config.h st.h boxdraw_data.h
     28 
     29 $(OBJ): config.h config.mk
     30 
     31 st: $(OBJ)
     32 	$(CC) -o $@ $(OBJ) $(STLDFLAGS)
     33 
     34 clean:
     35 	rm -f st $(OBJ) st-$(VERSION).tar.gz
     36 
     37 dist: clean
     38 	mkdir -p st-$(VERSION)
     39 	cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
     40 		config.def.h st.info st.1 arg.h st.h win.h $(SRC)\
     41 		st-$(VERSION)
     42 	tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
     43 	rm -rf st-$(VERSION)
     44 
     45 install: st
     46 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     47 	cp -f st $(DESTDIR)$(PREFIX)/bin
     48 	chmod 755 $(DESTDIR)$(PREFIX)/bin/st
     49 	tic -sx st.info
     50 	rm -f st *.o
     51 	@echo Please see the README file regarding the terminfo entry of st.
     52 
     53 uninstall:
     54 	rm -f $(DESTDIR)$(PREFIX)/bin/st
     55 
     56 .PHONY: all options clean dist install uninstall