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

Thanks a lot gerard. That worked.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.