1 %************************************************************************
3 \section[mkworld-macros-ghc]{CPP macros for @ghc@ project}
5 %************************************************************************
7 Rule to run the LML-ish \tr{ugen} utility.
9 /* ToDo: cmp -> $(CMP) */
12 #define UgenTarget(fileroot) @@\
13 ExtraStuffToBeVeryClean(fileroot.c fileroot.h fileroot.hs) @@\
14 fileroot.c : fileroot.ugn @@\
15 d=`dirname fileroot.ugn` ; f=`basename fileroot.ugn .ugn` ; \ @@\
16 $(RM) fileroot.c fileroot.hs "$$d/U_$$f.hs" fileroot.h-SAVE @@\
17 if [ -f fileroot.h ] ; then $(MV) -f fileroot.h fileroot.h-SAVE ; else exit 0 ; fi @@\
18 $(UGEN) fileroot.ugn || ( $(RM) fileroot.h fileroot.c fileroot.hs; $(MV) -f fileroot.h-SAVE fileroot.h ) @@\
19 if cmp -s fileroot.h-SAVE fileroot.h ; then \ @@\
20 $(MV) -f fileroot.h-SAVE fileroot.h ; \ @@\
22 chmod 444 fileroot.h fileroot.c fileroot.hs ; \ @@\
24 @$(RM) fileroot.h-SAVE @@\
25 @d=`dirname fileroot.ugn` ; f=`basename fileroot.ugn .ugn` ; \ @@\
26 $(MV) -f fileroot.hs "$$d/U_$$f.hs" @@\
28 fileroot.h : fileroot.c @@\
30 #endif /* UgenTarget */