fleet/orbit/pkg/dataflatten/testdata/nested/Makefile
2023-11-01 20:11:35 -06:00

29 lines
620 B
Makefile

TARGETS:= nested.xml nested.plist
all: $(TARGETS)
clean:
-rm $(TARGETS)
inner.xml: inner.json
plutil -convert xml1 -o $@ $^
inner.plist.b64: inner.json
plutil -convert binary1 -o - $^ | base64 -o $@
inner.plist: inner.json
plutil -convert binary1 -o $@ $^
nested.xml: nested.template.xml inner.xml inner.plist.b64
cat $< | ruby -pe ' \
require "cgi"; \
x = IO.readlines("inner.xml").join.chomp; \
b = IO.readlines("inner.plist.b64").join.chomp; \
STDIN.each_line { |l| l.sub!("INBINARY", b); l.sub!("INXML",CGI::escapeHTML(x)); puts l };' > $@
nested.plist: nested.xml
plutil -convert binary1 -o $@ $<