Skip to content
Snippets Groups Projects
Makefile 3.74 KiB
Newer Older
  • Learn to ignore specific revisions
  • Martin Stjernholm's avatar
    Martin Stjernholm committed
    #
    
    # $Id: Makefile,v 1.28 2000/08/05 13:36:23 mast Exp $
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    #
    # Meta Makefile
    #
    
    VPATH=.
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    OS=`uname -srm|sed -e 's/ /-/g'|tr '[A-Z]' '[a-z]'|tr '/' '_'`
    BUILDDIR=build/$(OS)
    METATARGET=
    
    
    # Use this to pass arguments to configure. Leave empty to keep previous args.
    CONFIGUREARGS=
    
    
    # Set to a flag for parallelizing make, e.g. -j2. It's given to make
    # at the level where it's most effective.
    
    MAKE_PARALLEL=
    
    # Used to avoid make compatibility problems.
    BIN_TRUE=":"
    
    
    MAKE_FLAGS="MAKE=$(MAKE)" "CONFIGUREARGS=$(CONFIGUREARGS)" "BUILDDIR=$(BUILDDIR)"
    
    
    	-@$(BIN_TRUE)
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    src/configure: src/configure.in
    	cd src && ./run_autoconfig . 2>&1 | grep -v warning
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    
    	cd src && ./run_autoconfig . 2>&1 | grep -v warning
    
    	@$(MAKE) $(MAKE_FLAGS) configure
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    	@builddir="$(BUILDDIR)"; \
    
    	  IFS='/'; \
    	  dir=`echo "$$builddir" | sed -e 's|[^/].*||'`; \
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    	  for d in $$builddir; do \
    	    dir="$$dir$$d"; \
    
    	    test x"$$dir" = x -o -d "$$dir" || mkdir "$$dir" || exit 1; \
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    	    dir="$$dir/"; \
    
    
    configure: src/configure builddir
    	@builddir="$(BUILDDIR)"; \
    	srcdir=`pwd`/src; \
    
    	cd "$$builddir" && { \
    
    	  if test -f .configureargs -a -z "$(CONFIGUREARGS)"; then \
    	    configureargs="`cat .configureargs`"; \
    	  else \
    
    Peter Bortas's avatar
    Peter Bortas committed
    	    configureargs="$(CONFIGUREARGS)"; \
    
    	  MAKE=$(MAKE) ; export MAKE ;\
    
    	  echo Configure arguments: $$configureargs; \
    	  echo; \
    
    	  if test -f Makefile -a -f config.cache -a -f .configureargs && \
    	     test "`cat .configureargs`" = "$$configureargs"; then :; \
    	  else \
    	    echo Running "$$srcdir"/configure $$configureargs in "$$builddir"; \
    
    	    CONFIG_SITE=x "$$srcdir"/configure $$configureargs && { \
    
    	      echo "$$configureargs" > .configureargs; \
    
    	      $(MAKE) "MAKE=$(MAKE)" clean > /dev/null; \
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    compile: configure
    	@builddir="$(BUILDDIR)"; \
    	metatarget="$(METATARGET)"; \
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    	test -f "$$builddir"/master.pike -a -x "$$builddir"/pike || \
              metatarget="all $$metatarget"; \
    	test "x$$metatarget" = x && metatarget=all; \
    
    	cd "$$builddir" && for target in $$metatarget; do \
    
    	  echo Making $$target in "$$builddir"; \
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    	  rm -f remake; \
    
    	  $(MAKE) "MAKE=$(MAKE)" "MAKE_PARALLEL=$(MAKE_PARALLEL)" $$target || { \
    
    	    res=$$?; \
    	    if test -f remake; then \
    
    	      $(MAKE) "MAKE=$(MAKE)" "MAKE_PARALLEL=$(MAKE_PARALLEL)" $$target || \
    		exit $$?; \
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    
    bin/pike: force
    	sed -e "s|\"BASEDIR\"|\"`pwd`\"|" < bin/pike.in > bin/pike
    	chmod a+x bin/pike
    
    
    # This skips the modules.
    pike: force
    
    	@$(MAKE) "METATARGET=pike master.pike"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    install:
    
    	@$(MAKE) "METATARGET=install"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    
    install_interactive:
    	@$(MAKE) "METATARGET=install_interactive"
    
    
    just_verify:
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=just_verify"
    
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    verify:
    
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=verify"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    verify_installed:
    
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=verify_installed"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    check: verify
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    sure: verify
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    verbose_verify:
    
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=verbose_verify"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    gdb_verify:
    
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=gdb_verify"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    run_hilfe:
    
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=run_hilfe"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    
    bin_export:
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=bin_export"
    
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    feature_list:
    
    	@$(MAKE) $(MAKE_FLAGS) "METATARGET=feature_list"
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    clean:
    
    	-cd "$(BUILDDIR)" && test -f Makefile && $(MAKE) "MAKE=$(MAKE)" clean
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    spotless:
    
    	-cd "$(BUILDDIR)" && test -f Makefile && $(MAKE) "MAKE=$(MAKE)" spotless
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    distclean:
    
    	-rm -rf build bin/pike
    
    Martin Stjernholm's avatar
    Martin Stjernholm committed
    
    cvsclean: distclean
    	for d in `find src -type d -print`; do if test -f "$$d/.cvsignore"; then (cd "$$d" && rm -f `cat ".cvsignore"`); else :; fi; done
    
    	-cd "$(BUILDDIR)" && $(MAKE) "MAKE=$(MAKE)" depend