3c9d84b3b844182750c60142a1154fe75a4fbee2
[ghc-hetmet.git] / ghc / mkworld / macros-ghc.jm
1 # line 9 "macros-ghc.ljm"
2 /* ToDo: cmp -> $(CMP) */
3
4 #ifndef UgenTarget
5 #define UgenTarget(fileroot)                                            @@\
6 ExtraStuffToBeVeryClean(fileroot.c fileroot.h fileroot.hs)              @@\
7 fileroot.c : fileroot.ugn                                               @@\
8         d=`dirname fileroot.ugn` ; f=`basename fileroot.ugn .ugn` ; \   @@\
9         $(RM) fileroot.c fileroot.hs "$$d/U_$$f.hs" fileroot.h-SAVE     @@\
10         if [ -f fileroot.h ] ; then $(MV) -f fileroot.h fileroot.h-SAVE ; else exit 0 ; fi @@\
11         $(UGEN) fileroot.ugn || ( $(RM) fileroot.h fileroot.c fileroot.hs; $(MV) -f fileroot.h-SAVE fileroot.h )                                                @@\
12         if cmp -s fileroot.h-SAVE fileroot.h ; then \                   @@\
13             $(MV) -f fileroot.h-SAVE fileroot.h ; \                     @@\
14         else \                                                          @@\
15             chmod 444 fileroot.h fileroot.c fileroot.hs ; \             @@\
16         fi                                                              @@\
17         @$(RM) fileroot.h-SAVE                                          @@\
18         @d=`dirname fileroot.ugn` ; f=`basename fileroot.ugn .ugn` ; \  @@\
19         $(MV) -f fileroot.hs "$$d/U_$$f.hs"                             @@\
20                                                                         @@\
21 fileroot.h : fileroot.c                                                 @@\
22         @: /* no-op */
23 #endif /* UgenTarget */