Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   makefile (http://www.go4expert.com/forums/makefile-t2936/)

cimon 9Feb2007 23:29


I am not sure if i am posting my query in the rt forum section.

Ok ..i wanted to know how to make makefile for my C programs in windows.
Pls help
Thank you

shabbir 10Feb2007 09:42

Re: makefile
You have posted it in the right forum but in the wrong section. I have moved your query as an article to the forums for discussion.

You can use the export make file function in the MS compiler and see what it contains and then use it to your needs and modify as needed.

DaWei 10Feb2007 10:29

Re: makefile
The same is true if your compiler happens to be Dev-Cpp (an IDE which uses Mingw).

cimon 11Feb2007 15:11

Re: makefile

I dont have a MS compiler.
I have Turbo C 2.0

Can u pls tell...how to make a makefile in this one.......
i wanted to try out and execute an online code which is accompanied with its makefile but it is not executing on windows........here is the makefile that was also available online


facetrain: facetrain.o imagenet.o backprop_initr.o pgmimage.o
$(CC) ${LFLAGS} facetrain.o imagenet.o backprop_initr.o pgmimage.o \
-o facetrain -lm

hidtopgm: hidtopgm.o pgmimage.o backprop_initr.o
$(CC) ${LFLAGS} hidtopgm.o pgmimage.o backprop_initr.o \
-o hidtopgm -lm

outtopgm: outtopgm.o pgmimage.o backprop_initr.o
$(CC) ${LFLAGS} outtopgm.o pgmimage.o backprop_initr.o \
-o outtopgm -lm

facetrain_init0: facetrain.o imagenet.o backprop_init0.o pgmimage.o
$(CC) ${LFLAGS} facetrain.o imagenet.o backprop_init0.o pgmimage.o \
-o facetrain_init0 -lm

backprop_initr.o: backprop.c backprop.h
$(CC) ${CFLAGS} -c backprop.c
mv backprop.o backprop_initr.o

backprop_init0.o: backprop.c backprop.h
$(CC) ${CFLAGS} -c -DINITZERO backprop.c
mv backprop.o backprop_init0.o

Now i also have these files mentioned in makefile........
Now how to make it work on windows.

Pls help

cimon 11Feb2007 15:52

Re: makefile
And as you mentioned dev C++

I have installed dev C++...but not able to even compile the files...
the files were compiling in turbo c

I created a project named code and added all these 8 files in it.........but on executing it gives e a build error
C:\Dev-Cpp\Makefile.win [Build Error] [code.exe] Error 1

DaWei 11Feb2007 19:15

Re: makefile
You should use a modern compiler. It is entirely possible that code written in the heydey of Turbo C 2.0 won't run on a modern machine. For instance, modern desktop machines, whether Windows or *nix or something else, run in a protected mode that ordinarily prevents one from accessing all memory freely, or from accessing I/O ports. Old Borland code for graphics operations, for instance, has to be rewritten. How it has to be rewritten is entirely platform- and OS-dependent. The fact that Turbo C will compile without complaining only means that Turbo C is non-compliant, or that it is not written for the current state of the platform.

Messing with a makefile is not going to solve these problems. Once you have working code, then the makefile thing is just another learning step.

shabbir 11Feb2007 22:34

Re: makefile
Also TC 2 and 3 used clrscr function which cannot be used in some modern day compilers.

Also I am not sure if there is a way to use the makefiles for turboC2 because as far as I remember my good old college days it did not had the concept of projects / workspace

All times are GMT +5.5. The time now is 07:04.