On Tue, Aug 27, 2013 at 4:22 PM, Jose A. Lopes <[email protected]> wrote: >> > +src/hs2py-constants: src/hs2py-constants.hs src/Ganeti/BasicTypes.hs \ >> > + src/Ganeti/JSON.hs src/Ganeti/THH.hs \ >> > + src/Ganeti/Hs2Py/GenConstants.hs \ >> > + src/Ganeti/Hs2Py/ListConstants.hs \ >> > + src/Ganeti/HsConstants.hs \ >> > + src/Ganeti/PyValueInstances.hs \ >> > + | stamp-srclinks >> > + $(GHC) --make \ >> > + $(HFLAGS) \ >> > + -osuf $(notdir $@).o -hisuf $(notdir $@).hi \ >> > + $(HEXTRA) $(HEXTRA_INT) src/hs2py-constants.hs >> > + >> >> This and HS_PROG_SRCS above are good just because this is going away soon. :) > > I will add a comment to the Makefile with an explanation why the two > rules are necessary for the time being. > >> Also: Ouch! Any way to make it slightly more beautiful? Or should we >> have a small script that does it instead of grep + sed + m4? >> (or maybe we can have fewer commands and optimize it a bit?) > > I can do one 'sed' and one 'm4'. What do you think ? > > NAMES=$$(sed -n -e "/=/ s/\(.*\) =.*/ '\1:/g p" \ > $(abs_top_srcdir)/src/Ganeti/HsConstants.hs); \ > m4 -DPY_CONSTANT_NAMES="$$NAMES" $(abs_top_srcdir)/$< > $@ >
Ok, LGTM Thanks, Guido
