خرید بک لینک

Vote count: 0

We can add patte rules such as %.c or %.o which mimics *.c or .o in bash (it searches for all files that have extension .c or .o. This is very useful if you have several targets, so you don't have to write all rules. I would like to know how to use this trick if your target files (.c or .o) are in the previous directory. In bash, one can write ../.c, but ../%.c does not work in makefile as I tested. How do you do such thing in makefile?

My second question: sometimes one would like to add header dependencies like this:

HEADER=factorial.h

%.o: %.c $(HEADERS) gcc -o program $%

It is a good idea to add a header dependency because sometimes you don't know whether or not the included libraries have some change.

Here we have to manually type the file names for HEADER.

How do I make it so it can scan the target file's included headers?

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 11 مرداد 1395 ساعت: 9:25

صفحه بندی