Commit Diff


commit - e3104fa570bd763e4e49bfad1762926f304adfdb
commit + 2a374334d5e6b99c4f070cc28e67428e04500105
blob - b1d8661c78a168e1b189e6def88102d7c214197f
blob + d2bbe7107652b95a34ff12e7cf08204a2b2db682
--- Makefile
+++ Makefile
@@ -1,3 +1,4 @@
+PREFIX = /usr/local
 OBJ = parse.o lex.o gen.o main.o
 
 all: destruct
@@ -10,6 +11,10 @@ run: destruct
 clean:
 	rm -f destruct destruct.inc y.tab.h test.[ch] *.o *.core
 
+install: destruct
+	mkdir -p ${DESTDIR}${PREFIX}/bin
+	cp -f destruct ${DESTDIR}${PREFIX}/bin/
+
 destruct: destruct.inc ${OBJ}
 	${CC} -o $@ ${OBJ}
 
blob - edb2587993b036674a776948e01030a5710189ea
blob + 3bf7f55332f92d2e9c896eae8ba728032009a799
--- parse.y
+++ parse.y
@@ -29,7 +29,7 @@ void yyerror (const char *, ...);
 %%
 
 file		: file struct ';'			{ list_push (&$$, &$1, $2.st); }
-      		|					{ list_new (&$$); }
+      		| struct ';'				{ list_new_with (&$$, $1.st); }
 		;
 
 struct		: STRUCT ident '{' items comma '}' 	{ structure (&$$, $2.s, &$4); }