|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
[C] Makefile per Visual Studio
Salve a tutti
Questo è quello che la mia ignoranza ha partorito Codice:
MAKE=nmake /nologo CC=cl /nologo all: programma.exe programma.exe: main.obj fun_bq.obj fun_io.obj fun_math.obj $(CC) main.obj fun_bq.obj fun_io.obj fun_math.obj /out:programma.exe main.obj: main.c fun_bq.h fun_math.h fun_io.h fun_bq.obj: fun_bq.c fun_bq.h fun_io.obj: fun_io.c fun_io.h fun_math.obj: fun_math.c fun_math.h #main.obj: main.c fun_bq.h fun_math.h fun_io.h # $(CC) $(cvars) main.c #fun_bq.obj: fun_bq.c fun_bq.h # $(CC) $(cvars) fun_bq.c #fun_io.obj: fun_io.c fun_io.h # $(CC) $(cvars) fun_io.c #fun_math.obj: fun_math.c fun_math.h # $(CC) $(cvars) fun_math.c Codice:
CC=gcc all: programma programma: main.o fun_bq.o fun_io.o fun_math.o $(CC) main.o fun_bq.o fun_io.o fun_math.o -o programma -lm -Wall main.o: main.c fun_bq.h fun_math.h fun_io.h $(CC) -c main.c fun_bq.o: fun_bq.c fun_bq.h $(CC) -c fun_bq.c fun_io.o: fun_io.c fun_io.h $(CC) -c fun_io.c fun_math.o: fun_math.c fun_math.h $(CC) -c fun_math.c clean: rm -rf *.o programma
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
|
|
|
|
|
#2 |
|
Bannato
Iscritto dal: Feb 2005
Città: Roma
Messaggi: 7029
|
non ti serve Visual Studio, ti basta il Windows SDK che è pure gratuito.
una volta che l'hai installato (queste indicazioni fanno riferimento alla versione 6.1, che è quella che ho io) vai su Start, All Programs, Microsoft Windows SDK v6.1, e apri CMD Shell; da lì puoi lanciare nmake. |
|
|
|
|
|
#3 | |
|
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Quote:
Dov'è l'errore nel Makefile che utilizzo sotto windows? Di nuovo grazie
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
|
|
|
|
|
|
#4 |
|
Bannato
Iscritto dal: Feb 2005
Città: Roma
Messaggi: 7029
|
"mi da errore" cosa significa? io avevo capito che non trovava nmake.exe, quindi ti dicevo di usare un build environment. quale programma di preciso ti da errore, nmake o cl? puoi riportare tutto l'output? ad una lettura veloce del makefile che hai scritto mi pare che l'unica irregolarità (e non sono neanche sicuro che sia un'irregolarità) è che alla linea 6, quando chiami cl coi file oggetto, l'opzione /out dovrebbe andare prima della lista dei files di input, non dopo.
|
|
|
|
|
|
#5 | |
|
Senior Member
Iscritto dal: Dec 2004
Messaggi: 783
|
Quote:
Codice:
MAKE=nmake /nologo CC=cl /nologo LDFLAGS=/link /subsystem:console /opt:ref all: programma.exe programma.exe: main.obj fun_boat.obj fun_io.obj fun_math.obj $(CC) main.obj fun_boat.obj fun_io.obj fun_math.obj $(LDFLAGS) /out:programma.exe main.obj: main.c fun_boat.h fun_math.h fun_io.h fun_boat.obj: fun_boat.c fun_boat.h fun_io.obj: fun_io.c fun_io.h fun_math.obj: fun_math.c fun_math.h #main.obj: main.c fun_boat.h fun_math.h fun_io.h # $(CC) $(cvars) main.c #fun_boat.obj: fun_boat.c fun_boat.h # $(CC) $(cvars) fun_boat.c #fun_io.obj: fun_io.c fun_io.h # $(CC) $(cvars) fun_io.c #fun_math.obj: fun_math.c fun_math.h # $(CC) $(cvars) fun_math.c Ciao
__________________
"May the wind always be at your back and the sun upon your face. And may the wings of destiny carry you aloft to dance with the stars...." |
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 22:29.




















