Makefile on Cygwin

拈花ヽ惹草 提交于 2019-12-19 07:34:51

问题


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.


回答1:


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

make -f Makefile.mak




回答2:


Type "make proj3" to run make successully.



来源:https://stackoverflow.com/questions/8110231/makefile-on-cygwin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!