Index: auto/output/Makefile
===================================================================
--- auto/output/Makefile	(revision 44f59b8b510ac7c3b21f669b0d25ed4cb4201f3f)
+++ auto/output/Makefile	(revision 12743b9e8ce96f3f0d743ab0459dacbc0fe2690c)
@@ -3,5 +3,5 @@
 cat << EOF > Makefile
 # Default target
-.DEFAULT: all
+.DEFAULT_GOAL = all
 
 SHELL = $SHELL
@@ -44,6 +44,10 @@
 
 PROGRAMS = tok
+
 TOK_OBJ_FILES = tok.o tok_cmdline.o
 TOK_FLEX_FILES = tok.l
+TOK_GGO_FILES = tok_cmdline.ggo
+tok.o: tok_cmdline.h
+
 CONFIG_FILES = src/config.h Makefile
 
@@ -51,7 +55,11 @@
 .SUFFIXES: .l .y .h .c .o
 
+.INTERMEDIATE: \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
+.INTERMEDIATE: \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
+.INTERMEDIATE: \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
+
 .PHONY: all
 all: \$(PROGRAMS)
-	#make -C app compile
+
 
 .PHONY: help
@@ -70,5 +78,6 @@
 	\$(RM) \$(TOK_OBJ_FILES)
 	\$(RM) \$(patsubst %.l,%.c,\$(TOK_FLEX_FILES))
-	#make -C app clean
+	\$(RM) \$(patsubst %.ggo,%.c,\$(TOK_GGO_FILES))
+	\$(RM) \$(patsubst %.ggo,%.h,\$(TOK_GGO_FILES))
 
 .PHONY: distclean
@@ -87,6 +96,12 @@
 	\$(CC) -c \$< -o \$@ \$(ALL_CFLAGS)
 
-%.o: %.l
+%.c: %.l
 	\$(FLEX) -t \$< > \$@
+
+%.c: %.ggo
+	gengetopt --input $< --file-name \$(patsubst %.c,%,\$@) --conf-parser
+
+%.h: %.ggo
+	gengetopt --input $< --file-name \$(patsubst %.h,%,\$@) --conf-parser
 
 %: %.o
