#!/usr/bin/make -f

all: build

build: build-arch build-indep

clean:
	test -d nx-X11 && cd nx-X11 && test -f Makefile && make $@ || true
	test -d nxcomp && cd nxcomp && test -f Makefile && make $@ || true
	test -d nxcompext && cd nxcompext && test -f Makefile && make $@ || true
	test -d nxcompshad && cd nxcompshad && test -f Makefile && make $@ || true
	test -d nxproxy && cd nxproxy && test -f Makefile && make $@ || true


distclean:
	test -d nx-X11 && cd nx-X11 && test -f Makefile && make $@ || true
	test -d nxcomp && cd nxcomp && test -f Makefile && make $@ || true
	test -d nxcompext && cd nxcompext && test -f Makefile && make $@ || true
	test -d nxcompshad && cd nxcompshad && test -f Makefile && make $@ || true
	test -d nxproxy && cd nxproxy && test -f Makefile && make $@ || true

build-arch:
	test -d nxcomp && cd nxcomp && autoconf
	test -d nxcompext && cd nxcompext && autoconf
	test -d nxcompshad && cd nxcompshad && autoconf
	test -d nx-X11 && cd nx-X11 && make World
	test -d nxproxy && cd nxproxy && autoconf && ./configure && make

build-indep:

install:
	test -d nxcomp && cd nxcomp && make install
	test -d nxcompext && cd nxcompext && make install
	test -d nxcompshad && cd nxcompshad && make install
	test -d nx-X11 && cd nx-X11 && make install
	test -d nxproxy && cd nxproxy && make install

uninstall:
	test -d nxcomp && cd nxcomp && make uninstall
	test -d nxcompext && cd nxcompext && make uninstall
	test -d nxcompshad && cd nxcompshad && make uninstall
	test -d nx-X11 && cd nx-X11 && make uninstall
	test -d nxproxy && cd nxproxy && make uninstall
