[project @ 1996-07-25 20:43:49 by partain]
[ghc-hetmet.git] / ghc / mkworld / macros-ghc.jm
1 /* ToDo: cmp -> $(CMP) */
2
3 #ifndef UgenTarget
4 #define UgenTarget(dir,fileroot)                                        @@\
5 ExtraStuffToBeVeryClean(dir/fileroot.c dir/fileroot.h dir/fileroot.hs)          @@\
6 dir/fileroot.c dir/CAT3(U_,fileroot,.hs): dir/fileroot.ugn                                              @@\
7         $(RM) dir/fileroot.c dir/fileroot.hs dir/CAT3(U_,fileroot,.hs) dir/fileroot.h-SAVE      @@\
8         if [ -f dir/fileroot.h ] ; then $(MV) -f dir/fileroot.h dir/fileroot.h-SAVE ; else exit 0 ; fi @@\
9         $(UGEN) dir/fileroot.ugn || ( $(RM) dir/fileroot.h dir/fileroot.c dir/CAT3(U_,fileroot,.hs); $(MV) -f dir/fileroot.h-SAVE dir/fileroot.h )                                              @@\
10         if cmp -s dir/fileroot.h-SAVE dir/fileroot.h ; then \                   @@\
11             $(MV) -f dir/fileroot.h-SAVE dir/fileroot.h ; \                     @@\
12         else \                                                                  @@\
13             chmod 444 dir/fileroot.h dir/fileroot.c dir/fileroot.hs ; \         @@\
14         fi                                                                      @@\
15         @$(RM) dir/fileroot.h-SAVE                                              @@\
16         $(MV) -f dir/fileroot.hs dir/CAT3(U_,fileroot,.hs)                      @@\
17                                                                                 @@\
18 dir/fileroot.h : dir/fileroot.c                                                 @@\
19         @: /* no-op */
20 #endif /* UgenTarget */