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?


Recommended Answers

All 5 Replies

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 *~

Hi! Any responses?

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

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

Thanks. I guess migrating to Linux makes sense.

Be a part of the DaniWeb community

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