Basic Compiling...

Pages: 12
Aug 27, 2013 at 5:09pm
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 Aug 27, 2013 at 10:14pm
Aug 27, 2013 at 9:33pm
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 Aug 27, 2013 at 9:37pm
Aug 27, 2013 at 10:08pm
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
Aug 29, 2013 at 4:53pm
oh ok.
Topic archived. No new replies allowed.
Pages: 12