Basic Compiling...

Pages: 12
You run make without arguments. The makefile has instructions for make.

make will look for GNUmakefile, Makefile then makefile in that order. So it'll find your makefile.

If you want to see what it would do, without actually executing the commands, run:
make -n

If you want for force a full rebuild, run:
make -B

If you want to force a debug build, run:
make CFLAGS=-g -B
Last edited on
Ah. Ok, I will do that then. Thank you for your help! :)

EDIT1: I need to have it use Ncurses. It won't compile with the library... I added -lncurses after -Wall and it still won't work.

Thanks for your time.
Last edited on
You need to add it to the link line. The makefile becomes:
1
2
3
4
5
6
7
8
9
10
11
PROG = main
SRC = main.o a.o b.o
CXXFLAGS = -pedantic-errors -Wall

all: ${PROG}

clean:
    rm ${SRC} ${PROG}

${PROG}: ${SRC}
    ${LINK.cc} -o $@ $^ -lncurses
oh ok.
Topic archived. No new replies allowed.
Pages: 12