Is there a way to create a Makefile without running. / Configure?
3 answers
You can of course write the makefile by hand. A quick googling reveals a variety of tutorials. This option looks promising.
For the cliff notes version, the example boils down to 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 $@
+2
source to share
If you are using Perl there is always a 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 little short, if you are just building an existing project , you may find it impossible to skip setting.
0
source to share