sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

Makefile (1530B)


      1 # tabbed - tabbing interface
      2 # See LICENSE file for copyright and license details.
      3 
      4 include config.mk
      5 
      6 SRC = tabbed.c
      7 OBJ = ${SRC:.c=.o}
      8 
      9 all: options tabbed
     10 
     11 options:
     12 	@echo tabbed build options:
     13 	@echo "CFLAGS   = ${CFLAGS}"
     14 	@echo "LDFLAGS  = ${LDFLAGS}"
     15 	@echo "CC       = ${CC}"
     16 
     17 .c.o:
     18 	@echo CC $<
     19 	@${CC} -c ${CFLAGS} $<
     20 
     21 ${OBJ}: config.h config.mk
     22 
     23 config.h:
     24 	@echo creating $@ from config.def.h
     25 	@cp config.def.h $@
     26 
     27 tabbed: tabbed.o
     28 	@echo CC -o $@
     29 	@${CC} -o $@ tabbed.o ${LDFLAGS}
     30 
     31 clean:
     32 	@echo cleaning
     33 	@rm -f tabbed ${OBJ} tabbed-${VERSION}.tar.gz
     34 
     35 dist: clean
     36 	@echo creating dist tarball
     37 	@mkdir -p tabbed-${VERSION}
     38 	@cp -R LICENSE Makefile README config.def.h config.mk \
     39 		tabbed.1 arg.h ${SRC} tabbed-${VERSION}
     40 	@tar -cf tabbed-${VERSION}.tar tabbed-${VERSION}
     41 	@gzip tabbed-${VERSION}.tar
     42 	@rm -rf tabbed-${VERSION}
     43 
     44 install: all
     45 	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
     46 	@mkdir -p ${DESTDIR}${PREFIX}/bin
     47 	@cp -f tabbed ${DESTDIR}${PREFIX}/bin
     48 	@chmod 755 ${DESTDIR}${PREFIX}/bin/tabbed
     49 	@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
     50 	@mkdir -p ${DESTDIR}${MANPREFIX}/man1
     51 	@sed "s/VERSION/${VERSION}/g" < tabbed.1 > ${DESTDIR}${MANPREFIX}/man1/tabbed.1
     52 	@chmod 644 ${DESTDIR}${MANPREFIX}/man1/tabbed.1
     53 
     54 uninstall:
     55 	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
     56 	@rm -f ${DESTDIR}${PREFIX}/bin/tabbed
     57 	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
     58 	@rm -f ${DESTDIR}${MANPREFIX}/man1/tabbed.1
     59 
     60 .PHONY: all options clean dist install uninstall