Port ctags+etags build to Sun C 5.12.
[bpt/emacs.git] / lib-src / Makefile.in
index 91d1323..3009ff2 100644 (file)
@@ -247,8 +247,8 @@ $(DESTDIR)${archlibdir}: all
          chown ${gameuser} "$(DESTDIR)${gamedir}"; \
          chmod u=rwx,g=rwx,o=rx "$(DESTDIR)${gamedir}"; \
        fi
-       if [ "`cd \"$(DESTDIR)${archlibdir}\" && /bin/pwd`" \
-             != "`cd ${srcdir} && /bin/pwd`" ]; then \
+       exp_archlibdir=`cd "$(DESTDIR)${archlibdir}" && /bin/pwd`; \
+       if [ "$$exp_archlibdir" != "`cd ${srcdir} && /bin/pwd`" ]; then \
          for file in ${SCRIPTS}; do \
            $(INSTALL_SCRIPT) ${srcdir}/$$file "$(DESTDIR)${archlibdir}/$$file"; \
          done ; \
@@ -311,18 +311,18 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
 
 
 etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
-etags_args = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" \
-       ${srcdir}/etags.c regex.o $(LOADLIBES) $(NTLIB) -o $@
+etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
+etags_libs = regex.o $(LOADLIBES) $(NTLIB)
 
 etags${EXEEXT}: ${etags_deps}
-       $(CC) ${ALL_CFLAGS} ${etags_args}
+       $(CC) ${ALL_CFLAGS} $(etags_cflags) $(srcdir)/etags.c $(etags_libs)
 
+## ctags.c is distinct from etags.c so that parallel makes do not write two
+## etags.o files on top of each other.
 ## FIXME?
-## Can't we use a symlink ctags -> etags, and make etags check for argv[0]?
-## Or a wrapper script that calls etags --ctags?
-ctags${EXEEXT}: ${etags_deps}
-       $(CC) ${ALL_CFLAGS} -DCTAGS ${etags_args}
-
+## Can't we use a wrapper that calls 'etags --ctags'?
+ctags${EXEEXT}: ctags.c ${etags_deps}
+       $(CC) ${ALL_CFLAGS} $(etags_cflags) $(srcdir)/ctags.c $(etags_libs)
 
 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
                    $(config_h)