NAME = eigen CC = g++ CFLAGS = -O LFLAGS = -O IN = $(wildcard *.in) # collect input file names OUT = $(patsubst %.in,%.out,$(IN)) # create output file names PS = $(patsubst %.in,%.ps,$(IN)) TEX = $(wildcard *.tex) # collect tex file names PDF = $(patsubst %.tex,%.pdf,$(TEX)) all: $(OUT) $(PS) $(PDF) $(NAME): $(NAME).o matrix.o # make the executable $(CC) -o $(NAME) $(LFLAGS) $(NAME).o matrix.o %.o:%.cc # compile source $(CC) $(CFLAGS) -c $< indent -br $< clean: # remove unneded files rm -f $(NAME) rm -f *.o rm -f *.ps rm -f $(NAME).*.out rm -f *.bak rm -f *.pdf rm -f *.log $(NAME).o: matrix.h matrix.o: matrix.h %.out:%.in $(NAME) # run executable with all the input files ./$(NAME) < $< > $@ cat $@ %.ps:%.out $(NAME).gnu # create figures from output files cp $< $(NAME).out gnuplot $(NAME).gnu rm $(NAME).out mv $(NAME)vector.ps vec.$@ mv $(NAME)value.ps $@ %.pdf:%.tex # tex the project description pdftex $<