
.PHONY : all clean

ifdef PRETTY_PRINT
	EXTRA_COMP_OPTIONS += --pretty-print
	EXTRA_LINK_OPTIONS += --pretty-print
endif

ifdef NO_LINK_OPTIMIZATION
	EXTRA_LINK_OPTIONS += --no-factorization --no-strip
endif

TDC := theme-d-compile
TDL := theme-d-link

all : generate-theme-d-code.go

clean :
	-rm -f generate-theme-d-code.go
	-rm -f generate-theme-d-code.tcp

generate-theme-d-code.go : generate-theme-d-code.tcp
	$(TDL) $(EXTRA_LINK_OPTIONS) -o $@ $<

%.tcp : %.thp
	$(TDC) $(EXTRA_COMP_OPTIONS) -o $@ $<

#%.tci : %.thi
#	$(TDC) $(EXTRA_COMP_OPTIONS) -o $@ $<

#%.tcb : %.thb %.tci
#	$(TDC) $(EXTRA_COMP_OPTIONS) -o $@ $<
