# makefile for Mastermind C example LOGISCOPE_INSTALL = ../../../.. OUTDIR = Objects INDIR = . RM = /bin/rm -f SRC = \ $(INDIR)/base.c \ $(INDIR)/machine.c \ $(INDIR)/master.c \ $(INDIR)/player.c \ $(INDIR)/score.c \ $(INDIR)/util.c \ $(INDIR)/write.c OBJ = \ $(OUTDIR)/base.o \ $(OUTDIR)/machine.o \ $(OUTDIR)/master.o \ $(OUTDIR)/player.o \ $(OUTDIR)/score.o \ $(OUTDIR)/util.o \ $(OUTDIR)/write.o LIBS=-static CC=gcc CPPFLAGS= $(OUTDIR): mkdir -p $(OUTDIR) $(OUTDIR)/%.o: $(INDIR)/%.c $(CC) -c $(CPPFLAGS) $(INDIR)/$*.c -o $@ $(OUTDIR)/vlgtchk.o: $(LOGISCOPE_INSTALL)/instr/src/vlgtchk.c $(CC) -c -DLIB $(LOGISCOPE_INSTALL)/instr/src/vlgtchk.c -o $@ #ttp creation CREATE='create -test -lang C $(TTP) -make "make lgmstrmind" -exec "xterm -e ./lgmstrmind" -- $(CC)' TTP=`pwd`/TestC.ttp #End ttp creation all: @echo "Possible targets are:" @echo " mstrmind: to build the mastermind binary" @echo " lgmstrmind: to build the instrumented binary" @echo " ttp: to create and build the Logiscope project file" @echo " clean: to clean the environement" mstrmind : $(OUTDIR) $(OUTDIR)/mstrmind $(OUTDIR)/mstrmind: $(OBJ) $(CC) $(CCFLAGS) -o $@ $(OBJ) $(LIBS) lgmstrmind : $(OUTDIR) $(OUTDIR)/lgmstrmind $(OUTDIR)/lgmstrmind: $(OBJ) $(OUTDIR)/vlgtchk.o $(CC) $(CCFLAGS) -o $@ $(OBJ) $(OUTDIR)/vlgtchk.o $(LIBS) clean : -$(RM) $(OBJ) $(OUTDIR)/mstrmind $(OUTDIR)/lgmstrmind $(INDIR)/*.inst.* TestC.ttp ttp: $(MAKE) CC=$(CREATE) mstrmind batch $(TTP)