# # Makefile # PROG= led SUBDIRS= src prefix= exec_prefix= ${prefix} bindir= ${exec_prefix}/bin datadir= ${prefix}/share mandir= ${prefix}/man libdir= ${exec_prefix}/lib .PHONY: all clean distclean install install-bin install-mod .PHONY: install-data # # subdir recursion macro # RECUR= @for dir in $(SUBDIRS) ; do \ echo "===> $$dir"; \ (cd $$dir && $(MAKE) $@) \ done all: $(RECUR) clean: $(RECUR) distclean: clean -rm -f config.cache config.status config.log src/config.h -rm -f Makefile src/Makefile src/modules/Makefile -rm -f src/modules/Makefile.module src/modules/vhighlight/Makefile install-bin: /usr/bin/install -c -o root -g wheel -d $(bindir) /usr/bin/install -c -o root -g wheel src/$(PROG) $(bindir) install-mod: cd src ; \ dynmods=`perl listmods.pl dynamic` ; \ if [ x"$$dynmods" != x"" ] ; then \ /usr/bin/install -c -o root -g wheel -d $(libdir)/$(PROG)/modules ; \ for file in $$dynmods ; do \ /usr/bin/install -c -o root -g wheel modules/build/$${file}.so \ $(libdir)/$(PROG)/modules ; \ done ; \ fi install-data: /usr/bin/install -c -o root -g wheel -d $(datadir)/$(PROG) cd share ; \ for i in `find . -type d | grep -v CVS` ; do \ /usr/bin/install -c -o root -g wheel -d $(datadir)/$(PROG)/$$i ; \ done ; \ for i in `find . -type f | grep -v CVS` ; do \ /usr/bin/install -c -o root -g wheel -m 444 $$i $(datadir)/$(PROG)/$$i ; \ done ( cd $(datadir)/$(PROG)/syntax ; \ ln -f -s c h ) install: all install-bin install-mod install-data deinstall: -rm -f $(bindir)/$(PROG) -rm -rf $(libdir)/$(PROG) -rm -rf $(datadir)/$(PROG)