gst

painless gist creator
git clone git://edryd.org/gst
Log | Files | Refs | LICENSE

Makefile (1407B)


      1 # gst - painless gist creator
      2 # See LICENSE file for copyright and license details.
      3 
      4 include config.mk
      5 
      6 EXE = gst
      7 SRC = gst.c extern/frozen.c
      8 OBJ = $(SRC:.c=.o)
      9 
     10 all: options $(EXE)
     11 
     12 options:
     13 	@echo $(EXE) build options:
     14 	@echo "CFLAGS  = $(CFLAGS)"
     15 	@echo "LDFLAGS = $(LDFLAGS)"
     16 
     17 .o:
     18 	@echo $(LD) $@
     19 	@$(LD) -o $@ $< $(LDFLAGS)
     20 
     21 .c.o:
     22 	@echo $(CC) $<
     23 	@$(CC) -c -o $@ $< $(CFLAGS)
     24 
     25 $(OBJ): config.h config.mk
     26 
     27 config.h:
     28 	@echo creating $@ from config.def.h
     29 	@cp config.def.h $@
     30 
     31 $(EXE): $(OBJ)
     32 	@echo $(CC) -o $@
     33 	@$(CC) -o $@ $(OBJ) $(LDFLAGS)
     34 
     35 clean:
     36 	@echo cleaning
     37 	@rm -f $(OBJ) $(EXE)
     38 
     39 install: all
     40 	@echo installing $(EXE) to $(DESTDIR)$(PREFIX)/bin
     41 	@mkdir -p $(DESTDIR)$(PREFIX)/bin
     42 	@cp -f $(EXE) $(DESTDIR)$(PREFIX)/bin
     43 	@chmod 755 $(DESTDIR)$(PREFIX)/bin/$(EXE)
     44 	@echo installing manual page to $(DESTDIR)$(MANPREFIX)/man1
     45 	@mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     46 	@cp -f $(EXE).1 $(DESTDIR)$(MANPREFIX)/man1/
     47 	@chmod 644 $(DESTDIR)$(MANPREFIX)/man1/$(EXE).1
     48 
     49 uninstall:
     50 	@echo removing $(EXE) from $(DESTDIR)$(PREFIX)/bin
     51 	@rm -f $(DESTDIR)$(PREFIX)/bin/$(EXE)
     52 	@echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
     53 	@rm -f $(DESTDIR)$(MANPREFIX)/man1/$(EXE).1
     54 
     55 man: $(EXE)
     56 	@echo updating man page $(EXE).1
     57 	@markman -nCD -t GST -V "$(EXE) $(VERSION)" -d "`date '+%B %Y'`" \
     58 		-s "`./$(EXE) -h 2>&1 | cut -d' ' -f2-`" README.md > $(EXE).1
     59 
     60 .PHONY: all options clean install uninstall man