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?


Re: Compiling open source projects 80 80

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 *~
Re: Compiling open source projects 80 80

Hi! Any responses?

Re: Compiling open source projects 80 80

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

Re: Compiling open source projects 80 80

Before anything I would suggest you to move to Linux for development work.

Re: Compiling open source projects 80 80

Thanks. I guess migrating to Linux makes sense.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.