mpi-genesis 1 PROGRAM = mpi.a
mpi-genesis 2
mpi-genesis 3 BUILD=obj
mpi-genesis 4 DIST=bin
mpi-genesis 5
mpi-genesis 6 CXX = gcc
mpi-genesis 7 OBJECTS = $(addprefix $(BUILD)/, $(patsubst %.c,%.o,$(wildcard *.c)))
mpi-genesis 8 FLAGS = -g -Wall
mpi-genesis 9 INCLUDE = -I include
mpi-genesis 10
mpi-genesis 11 .SUFFIXES: .o .c
mpi-genesis 12
mpi-genesis 13 $(BUILD)/%.o:
mpi-genesis 14 $(CXX) $(FLAGS) $(INCLUDE) -c $*.c -o $@
mpi-genesis 15
mpi-genesis 16 all: $(PROGRAM)
mpi-genesis 17
mpi-genesis 18 $(PROGRAM): $(OBJECTS)
mpi-genesis 19 ar rcs $(DIST)/$(PROGRAM) $(OBJECTS)
mpi-genesis 20
mpi-genesis 21 clean :
mpi-genesis 22 rm -rf nul core *flymake* $(BUILD)/*.o $(DIST)/$(PROGRAM) *~ bin/*
mpi-genesis 23
mpi-genesis 24 check-syntax:
mpi-genesis 25 $(CXX) -c $(FLAGS) $(INCLUDE) -o nul -Wall -S $(CHK_SOURCES)