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_second_cut 20 #ld -o $(DIST)/$(PROGRAM).o $(OBJECTS) -lc
mpi-genesis 21
mpi-genesis 22 clean :
mpi-genesis 23 rm -rf nul core *flymake* $(BUILD)/*.o $(DIST)/$(PROGRAM) *~ bin/*
mpi-genesis 24
mpi-genesis 25 check-syntax:
mpi-genesis 26 $(CXX) -c $(FLAGS) $(INCLUDE) -o nul -Wall -S $(CHK_SOURCES)