I'm a Windows user. I'm using Code::Blocks, and my c++ program utilizes and outside library (gmp). That means that I can't simply compile my program within Code::Blocks itself.
Rather, I have to use a Cygwin shell and compile it using this command:
g++ -o main main.cpp -lgmpxx -lgmp
I'd like to create a Makefile, so that I can pass this along to allow others to compile it easily, but I have very little experience with this. I tried to adapt a Makefile that was given to me for another project (done in Linux), but it's not working.
First, here is the Makefile as I have adapted it for my program:
1 2 3 4 5 6 7 8 9 10 11 12
|
CC = g++
CFLAGS = -O -lgmpxx -lgmp
OBJS = main.cpp
main: $(OBJS)
$(CC) $(CFLAGS) -o main $(OBJS)
main.o: main.cpp
clean:
rm -f *~ *.o main
|
I tried to execute this by calling:
make main
but I get an error from Cygwin
-bash: make command not found |
Can anyone offer any advice, either to modify the Makefile or in how I execute it? Thanks!