diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-13 17:05:54 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-09-13 17:05:54 +0200 |
commit | 6627513d260e807f99fd02cc6571601d794437de (patch) | |
tree | 0a434b98f24af212671f952ee211a2382f223c2c /src/GNUmakefile | |
download | biruda-6627513d260e807f99fd02cc6571601d794437de.tar.gz biruda-6627513d260e807f99fd02cc6571601d794437de.tar.bz2 |
added command line and config parsing
Diffstat (limited to 'src/GNUmakefile')
-rw-r--r-- | src/GNUmakefile | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/GNUmakefile b/src/GNUmakefile new file mode 100644 index 0000000..cd74947 --- /dev/null +++ b/src/GNUmakefile @@ -0,0 +1,42 @@ +.PHONY: all clean install + +all: biruda + +CFLAGS = -g -std=c99 -Wall -pedantic +LDFLAGS = +LIBS = -lconfuse + +%.o : %.c + $(CC) $(CFLAGS) -c -o $@ $< + +biruda: biruda.o biruda_cmdline.o + $(CC) -o $@ $(LDFLAGS) $^ $(LIBS) + +biruda_cmdline.o: biruda_cmdline.c +biruda.o: biruda.c biruda_cmdline.h + +biruda_cmdline.c: biruda.ggo + gengetopt -F biruda_cmdline --unamed-opts --conf-parser --include-getopt -i $< + +biruda_cmdline.h: biruda.ggo + gengetopt -F biruda_cmdline --unamed-opts --conf-parser --include-getopt -i $< + +clean: + @-rm *.o + @-rm biruda + @-rm biruda_cmdline.[ch] + +# default values +DESTDIR ?= +prefix ?= /usr + +# standard directories following FHS +execdir=$(prefix) +sbindir=$(execdir)/sbin +sysconfdir=$(execdir)/etc + +install: + @test -d $(DESTDIR)$(sbindir) || install -d -m 0755 $(DESTDIR)$(sbindir) + install -m 0775 biruda $(DESTDIR)$(sbindir) + @test -d $(DESTDIR)$(sysconfdir)/biruda || install -d -m 0755 $(DESTDIR)$(sysconfdir)/biruda + install -m 0644 biruda.conf $(DESTDIR)$(sysconfdir)/biruda |