Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Makefile on Cygwin

I'm trying to use makefile on Windows 7 x64 with Cygwin. I type "make" and the error that i get is:

make: * No targets specified and no makefile found. Stop.

Makefile:

 CC = g++
 CFLAGS = -g -Wall -pedantic
 HDRS = node.h stack.h
 SRCS = stack.cpp main.cpp
 OBJS = $(patsubst %.cpp, %.o, $(SRCS))

 proj3:$(OBJS)
   $(CC) $(CFLAGS) -o $@ $(OBJS)
 %.o: %.cpp $(HDRS)
   $(CC)    $(CFLAGS) -c $<
 .PHONY:clean
  clean:
-rm -f *.o *~ *core* proj3 

None of the files are missing.

like image 242
max Avatar asked Nov 13 '11 07:11

max


People also ask

How do I enable Makefile in Cygwin?

You have to install the make command. Run the Cygwin installation/configuration program, setup-x86_64.exe or setup-x86.exe (you should already have it, downloaded from here).

Does make work on Cygwin?

When you get to the screen that lets you select packages to install, find make and select it (it's probably under "Development" or something similar). Then you'll be able to run make from the Cygwin bash command line.

What is make command in Cygwin?

description: A GNU tool for controlling the generation of executables and other non-source files of a program from the program's source files. Make allows users to build and install packages without any significant knowledge about the details of the build process.


2 Answers

Question SOLVED: i had makefile in my directory as Makefile.mak I typed in Cygwin

make -f Makefile.mak

like image 56
max Avatar answered Oct 13 '22 15:10

max


Type "make proj3" to run make successully.

like image 1
steve Avatar answered Oct 13 '22 14:10

steve