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