Hello guys.. I have this makefile:

MyMatrix‬‬: MyMatrix.o
	gcc MyMatrix.o -o MyMatrix

MyMatrix.o: MyMatrix.c
	gcc -c MyMatrix.c

MyStringMain: MyString.o MyStringMain.o
	gcc  MyString.o MyStringMain.o -o MyString -o MyStringRun

MyStringMain.o: MyStringMain.c MyString.c MyString.h
	gcc -c MyStringMain.c 

MyString.o: MyString.c MyString.h
	gcc -c MyString.c


.PHONY:clean
clean: 
	rm -f *.o test.out

For some reason, only the MyMatrix file is created.. Any ideas why?

*p.s: all the files are good and have no errors.

Try this one

MyMatrix‬‬: MyMatrix.o MyStringMain
	gcc MyMatrix.o -o MyMatrix

MyMatrix.o: MyMatrix.c
	gcc -c MyMatrix.c

MyStringMain: MyString.o MyStringMain.o
	gcc  MyString.o MyStringMain.o -o MyString -o MyStringRun

MyStringMain.o: MyStringMain.c MyString.c MyString.h
	gcc -c MyStringMain.c 

MyString.o: MyString.c MyString.h
	gcc -c MyString.c


.PHONY:clean
clean: 
	rm -f *.o test.out
This question has already been answered. Start a new discussion instead.