Bonjour !

Je souhaiterais modifier le Makefile d'un projet existant pour pouvoir compiler au choix en 32 ou 64 bits. Apparemment la modification que j'ai faite n'est pas bonne. On dirait que les fichiers *.o sont toujours compilés en 64 bits, ce qui me donne l'erreur suivante quand je veux compiler en 32 bits :

Code X : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[roland@portable source]$ LC_ALL=C make sachy32
gcc -Wall   -c -o main.o main.c
gcc -Wall   -c -o inic.o inic.c
gcc -Wall   -c -o interf.o interf.c
gcc -Wall   -c -o movegen.o movegen.c
gcc -Wall   -c -o value.o value.c
gcc -Wall   -c -o rules.o rules.c
gcc -Wall   -c -o makemove.o makemove.c
gcc -Wall   -c -o search.o search.c
gcc -Wall   -c -o test.o test.c
gcc -Wall   -c -o sort.o sort.c
gcc -Wall   -c -o book.o book.c
gcc -o sachy32 main.o inic.o interf.o movegen.o value.o rules.o makemove.o search.o test.o sort.o book.o -m32
/usr/bin/ld: i386:x86-64 architecture of input file `main.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `inic.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `interf.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `movegen.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `value.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `rules.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `makemove.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `search.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `test.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `sort.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `book.o' is incompatible with i386 output
collect2: error: ld returned 1 exit status
make: *** [Makefile:12: sachy32] Error 1
[roland@portable source]$

Voici mon Makefile :

Code Makefile : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Makefile pro SACHY
 
CC = gcc
CFLAGS = -Wall
 
objects = main.o inic.o interf.o movegen.o value.o rules.o makemove.o search.o test.o sort.o book.o
 
sachy:  $(objects)
	$(CC) -o sachy $(objects)
 
sachy32:  $(objects)
	$(CC) -o sachy32 $(objects) -m32
 
sachy64:  $(objects)
	$(CC) -o sachy64 $(objects)
 
$(objects): data.h 
 
.PHONY: clean
 
clean:
	rm sachy $(objects)

Mais je ne vois pas la commande pour les fichiers *.o...