diff --git a/Makefile b/Makefile index fb6c196..0e93870 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,19 @@ -CFLAGS=`pkg-config --libs --cflags zlib` -unpack: unpack.c - gcc -Wall $(CFLAGS) -o unpack unpack.c +CFLAGS += $(shell pkg-config --libs --cflags zlib) +CFLAGS += -Wall + +ifndef CC +CC = gcc +endif + +APP = unpack +TMP_FILES = $(wildcard *~) + +all: $(APP) + +%: %.c + $(CC) $(CFLAGS) -o $@ $< + +clean: + rm -rf $(APP) $(TMP_FILES) + diff --git a/thing.rb b/thing.rb index f6f8a70..eeb8123 100644 --- a/thing.rb +++ b/thing.rb @@ -298,7 +298,13 @@ if $0 == __FILE__ file.write(parent.to_json) end - puts "Wrote:\n [%d] %s\n [%d] %s" % [File.size(txt_name), txt_name, File.size(json_name), json_name] + + binary.flush # the bits need to be written before showing the size of the file + + puts "Wrote:" + [txt_name, json_name, binary.path].each do |filename| + puts " [%d] %s" % [File.size(filename), filename] + end end end