I have been trying to compile open source projects since past few months with no success. I just don't know how to go about the entire thing. Readings over the internet have not helped much.

Some come with ./Configure and a Makefile while others with only a Makefile. How to use them to generate executables (or they have some other purpose :?:).

My machine currently has:

  • Windows XP
  • Mingw Compiler for C/C++
  • Cygwin

Do I need any other software?


Edited by iammirko: n/a

7 Years
Discussion Span
Last Post by iammirko

This time I am trying to compile the nullHttpd project. The project comes with around 9 source files and a Makefile. The contents read as follows:

# Makefile for Null httpd
CC      = gcc
CFLAGS  = -Wall -O2 -s -I./include
LDFLAGS = -lpthread
OBJECTS = cgi.o config.o files.o format.o http.o main.o server.o

	rm -f *.o
	make httpd

httpd: $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o ../httpd/bin/httpd
	@echo Make httpd is complete.

	rm -f ../httpd/bin/httpd *.o *~

Edited by iammirko: n/a


Makefiles are ways to effectively reduce the user burden by just executing one script which will perform the compilation for you.

In order to run a makefile you will need to do the following

1) Make Sure that your MinGw compiler directory is in the windows global Environment variables.

If that is done.

you could just use the Command prompt (START>RUN>CMD) and go to the directory where the codes are present and type

'make' to execute it

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.