views:

137

answers:

3

I'd like to skip the tests and create a (default) Makefile.

+2  A: 

Of course you can write a makefile by hand. A quick googling shows LOTS of tutorials. This one looks promising.

For the cliffs notes version, the example boils down this:

CC=g++
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=main.cpp hello.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS) 
    $(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
    $(CC) $(CFLAGS) $< -o $@
Evan Teran
Nitpick: The prevalent convention is to use CC and CFLAGS for the C compiler (gcc) and CXX and CXXFLAGS for the C++ compiler (g++).
palm3D
A: 

If you happen to be using Perl, there's always good ol'

use ExtUtils::MakeMaker;

WriteMakefile(
    'NAME' => 'Foo::Bar',
    'DISTNAME' => 'Foo-Bar',
    'EXE_FILES' => ["foobar.sh"],
    'VERSION_FROM' => 'lib/Foo/Bar.pm',
    );

However, your question is a bit short, if you are merely building an existing project you may find it impossible to skip configure.

Kent Fredric
+1  A: 

Why would you want to second guess what the author laboured over? People don't generate configure scripts for fun - they generate configure scripts because determining the correct way to compile the program on your system is hard and running ./configure is easier than all the alternatives.

Jonathan Leffler