CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   about making makefile (https://www.cfd-online.com/Forums/main/3470-about-making-makefile.html)

JunseokKim May 16, 2001 20:05

about making makefile
 
I have a couple of C programs, and I wonder what are people's usesage of makefile.

My compilers are cc, gcc.

For detail, I have five files.

main.c main.h

file2.c file2.h

file3.c file3.h

file4.c file4.h

file5.c file5.h

These files are interconnected, that is they are using each other's function definitions.

what are possible makefile forms?

Thanks in advance.


Sebastien Perron May 16, 2001 21:39

Re: about making makefile
 
This is in no way related to CFD. But here is an exemple of a simple makefile:

_____________________________________________

CC= gcc STD= _GNU_SOURCE DEBUG= -O2 OBJS=\ dos_cvrt.o\ unix2dos.o\ dos2unix.o\ put_ch.o

.c.o:

$(CC) -c $(DEBUG) -Wall -D$(STD) $<

all: dos_cvrt unix_cvrt

dos_cvrt: $(OBJS)

$(CC) $(OBJS) -o dos_cvrt

unix_cvrt : dos_cvrt

rm -f unix_cvrt

ln dos_cvrt unix_cvrt

clean:

rm -f *.o *.core

clobber:

rm -f *.o *.core dos_cvrt unix_cvrt

__________________________________________________


All times are GMT -4. The time now is 22:39.