
CC=mpiCC
CCFLAGS=-O2
PODFLAG=-c 'User Contributed OAR Documentation' -r 'LEGI Trokata'


.PHONY: all clean distclean

all: mpilauncher mpilauncher.1 oar-envsh.1 oar-dispatch.1 oar-parexec.1

clean:
	rm -f *.o

distclean: clean
	rm -f mpilauncher


mpilauncher: mpilauncher.o
	$(CC) $(CCFLAGS) -o $@ $<

%.o: %.cpp
	$(CC) $(CCFLAGS) -c $<

%.1: %.cpp
	sed -re 's#^[/ ]\* ?##; s#^// ?##' $< | pod2man -n $* $(PODFLAG) > $@

%.1: %
	pod2man -n $* $(PODFLAG) $< > $@

# astyle --style=banner -s3 mpilauncher.cpp
