# BlinkenLib # version 0.6.1 date 2008-07-22 # Copyright 2004-2008 Stefan Schuermans # Copyleft: GNU public license - http://www.gnu.org/copyleft/gpl.html # a blinkenarea.org project CC=gcc .phony: all clean all: config.cfg config.mk config.h mng.cfg: echo -n "MNG=" >mng.cfg (($(CC) -o mng mng.c -lmng && ./mng && echo "1") || echo "0") >>mng.cfg rm -f mng config.cfg: mng.cfg cat $+ >config.cfg config.mk: config.cfg sed 's/^\([A-Z]*\)=\([01]\)$$/BLINKENLIB_CFG_\1=\2/' <$< >$@ config.h: config.cfg sed 's/^\([A-Z]*\)=0$$/#undef BLINKENLIB_CFG_\1/;s/^\([A-Z]*\)=1$$/#define BLINKENLIB_CFG_\1/' <$< >$@ echo -n '#define BLINKENLIB_CONFIG "' >>$@ sed 's/^\([A-Z]*\)=0$$/\1-/;s/^\([A-Z]*\)=1$$/\1+/' <$< | tr '\n' ' ' | sed 's/ *$$//' >>$@ echo '"' >>$@ clean: rm -f *.cfg config.mk config.h