RANLIB = @RANLIB@
INSTALL = @INSTALL@
-PRJDIR = ../..
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
PKGDIR = ../
DEFS = $(subs -DHAVE_CONFIG_H,,@DEFS@)
-CPPFLAGS = @CPPFLAGS@ -I. -I$(PRJDIR) -I$(PKGDIR)
+CPPFLAGS = @CPPFLAGS@ -I. -I$(top_builddir) -I$(PKGDIR)
CFLAGS = @CFLAGS@ -Wall
CXXFLAGS = @CXXFLAGS@ -Wall
M_OR_MM = @M_OR_MM@
-LIBS = -L$(PRJDIR) -L$(PKGDIR) -lgui @CURSES_LIBS@ -lutil @LIBS@
+LIBS = -L$(top_builddir) -L$(PKGDIR) -lgui @CURSES_LIBS@ -lutil @LIBS@
curses_ok = @curses_ok@
# ---------------------
dep: Makefile.dep
-Makefile.dep: *.cc *.h $(PRJDIR)/*.h $(PKGDIR)/*.h
- $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) *.cc >Makefile.dep
+Makefile.dep: $(srcdir)/*.cc $(top_builddir)*.h $(PKGDIR)/*.h
+ $(CXXCPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.cc,$^) >Makefile.dep
include Makefile.dep
include clean.mk
portmon.src:
endif
-portmon: $(OBJECTS) $(PRJDIR)/*.a $(PKGDIR)/*.a
+portmon: $(OBJECTS) $(top_builddir)*.a $(PKGDIR)/*.a
$(CXX) $(CXXFLAGS) -o portmon $(OBJECTS) $(LIBS)
ifeq ($(curses_ok),yes)
otherlibs:
- cd $(PRJDIR) && $(MAKE) libs
- cd $(PKGDIR) && $(MAKE) libs
+ $(MAKE) -C $(top_builddir) libs
+ $(MAKE) -C $(PKGDIR) libs
else
otherlibs:
endif
# Remaking configuration
# ----------------------
checkconf:
- @if [ -f $(PRJDIR)/devel ]; then\
- $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
+ @if [ -f $(top_builddir)devel ]; then\
+ $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
fi
# End of gui.src/portmon.src/Makefile.in