[inseparable changes from patch from perl5.003_12 to perl5.003_13]
[p5sagit/p5-mst-13.2.git] / Makefile.SH
index e3ee814..db3b776 100755 (executable)
@@ -243,7 +243,7 @@ $(LIBPERL): $& perl$(OBJ_EXT) $(obj)
        case "$useshrplib" in
        true)
                $spitshell >>Makefile <<'!NO!SUBS!'
-       $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj)
+       $(LD) $(LDDLFLAGS) -o $@ perl$(OBJ_EXT) $(obj) $(libs)
 !NO!SUBS!
                ;;
        *)
@@ -285,7 +285,7 @@ quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
 # has been invoked correctly.
 
 suidperl: $& sperl$(OBJ_EXT) perlmain$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) ext.libs
-       $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(LIBPERL) $(DYNALOADER) $(static_ext) `cat ext.libs` $(libs)
+       $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o suidperl perlmain$(OBJ_EXT) sperl$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LIBPERL) `cat ext.libs` $(libs)
 
 !NO!SUBS!
 
@@ -342,9 +342,10 @@ run_byacc: FORCE
        @ echo 'Expect' 130 shift/reduce and 1 reduce/reduce conflict
        $(BYACC) -d perly.y
        sh $(shellflags) ./perly.fixer y.tab.c perly.c
-       sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' perly.c >perly.tmp && mv perly.tmp perly.c
-       mv y.tab.h perly.h
-       echo 'extern YYSTYPE yylval;' >>perly.h
+       sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+           -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
+       echo 'extern YYSTYPE yylval;' >>y.tab.h
+       cmp -s y.tab.h perly.h && rm -f y.tab.h || mv y.tab.h perly.h
        - perl vms/vms_yfix.pl perly.c perly.h vms/perly_c.vms vms/perly_h.vms
 
 # We don't want to regenerate perly.c and perly.h, but they might
@@ -400,7 +401,16 @@ clean:
        done
        rm -f perl suidperl miniperl $(LIBPERL)
 
-realclean: clean
+realclean: clean _cleaner
+       @echo "Note that make realclean does not delete config.sh"
+
+clobber:       clean _cleaner
+       rm -f config.sh cppstdin
+
+distclean:     clobber
+
+# Do not 'make _cleaner' directly.
+_cleaner:
        -cd os2; rm -f Makefile
        -cd pod; $(MAKE) realclean
        -cd utils; $(MAKE) realclean
@@ -416,12 +426,6 @@ realclean: clean
        rm -f lib/.exists
        rm -f h2ph.man pstruct
        rm -rf .config
-       @echo "Note that make realclean does not delete config.sh"
-
-clobber:       realclean
-       rm -f config.sh cppstdin
-
-distclean:     clobber
 
 # The following lint has practically everything turned on.  Unfortunately,
 # you have to wade through a lot of mumbo jumbo that can't be suppressed.