Make generated C files a bit nicer to look at
This commit is contained in:
parent
9da35b5854
commit
fe24e4f01b
@ -7,12 +7,16 @@ game: data/actions.c data/rooms.c data/transitions.c data/words.c data/flags.c *
|
|||||||
$(CC) *.c $(CFLAGS) -o game
|
$(CC) *.c $(CFLAGS) -o game
|
||||||
|
|
||||||
data/%.c: data/%.txt
|
data/%.c: data/%.txt
|
||||||
echo -n "char *data_$*_txt = \"" > data/$*.c
|
echo "char *data_$*_txt = " > data/$*.c
|
||||||
cat data/$*.txt | perl -pe 's/\n/\\n/g' >> data/$*.c
|
cat data/$*.txt | \
|
||||||
echo "\";" >> data/$*.c
|
perl -pe 's/ *\| */|/g' | \
|
||||||
|
perl -pe 's/^/"/' | \
|
||||||
|
perl -pe 's/$$/\\n"/' >> data/$*.c
|
||||||
|
echo ";" >> data/$*.c
|
||||||
|
|
||||||
run: game
|
run: game
|
||||||
./game
|
./game
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f ./game
|
rm -f ./game
|
||||||
|
rm -f ./data/*.c
|
||||||
|
Loading…
Reference in New Issue
Block a user