LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   reuse Makefile on different .c? (https://www.linuxquestions.org/questions/linux-newbie-8/reuse-makefile-on-different-c-251962/)

chunlee 11-06-2004 07:48 PM

reuse Makefile on different .c?
 
hi there:

i have just figured out how to do a simple Makefile but got this question. how would i write a makefile that can be reused by several .c files? what i have now is:

COMPILER = gcc
CCFLAGS = -lm
myprogram: byteorder.c
${COMPILER} ${CCFLAGS} -o byteorder2 byteorder.c

clean:
rm -rf *.o a.out

i want both "buteorder.c" and "byteorder" to be a variable, so that it can be used by other .c files.

cheers

CHUN


All times are GMT -5. The time now is 11:00 AM.