linux - Running make run 2 times on a makefile -


i'm running 2 executalble makefile, , got problem: everytime make run (heuristica or otimo) runs otimo , runs exe i've said run (if choose otimo runs 2 times). i'm using linux (kubuntu 12.10). want use make run separate, , if choose run one, don't want run other or that. can me on that? makelfile code:

# lista dos objetos: objs = main.o grafo.o circulo.o arquivos.o lista.o   # nome dos executáveis: main1 = tp2h  main2 = tp2o  # argumentos para execução dos programas: args  = input.txt output.txt args2 = input.txt output.txt  # especifica o compilador: cc = gcc  # especifica opções compilador: cflags = -wall -pg -g3  # compilação dos programas: all: $(main1) $(main2)  $(main1): $(objs)     @$(cc) $(cflags) $(objs) -lm -o $(main1) $(main2): $(objs)     @$(cc) $(cflags) $(objs) -lm -o $(main2) %.o: %.c %.h     @$(cc) $(cflags) $< -c   # execução dos programas:  run heuristica:     ./$(main1) $(args) run otimo:     ./$(main2) $(args2)  # remoção dos objetos pré-compilados: clean:      rm *.o 

thanks on that!

the problem these multiple word "targets" using. makefile targets should single word. correct can either take "run" out of target. or can use underscore instead of space.

example 1:

# execução dos programas:  heuristica:     ./$(main1) $(args) otimo:     ./$(main2) $(args2) 

example 2:

# execução dos programas:  run_heuristica:     ./$(main1) $(args) run_otimo:     ./$(main2) $(args2) 

Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -