sistema_progs

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

Makefile (1779B)


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