aostruszka / nonrec-make

Non-recursive make template for GNU make

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

not a layer?socute

jinCN opened this issue · comments

commented

???
Could you elaborate?
There is no description and the title does not say anything to me.

Thank you

commented

Sorry.
Not a lawyer?So cute!
Thank you^_^

commented

your makefile is:
mk/Makefile

and I run:
make

then I get error:
Makefile:1: *** 遗漏分隔符 。 停止。

so what's wrong please?

I'm not sure what you're trying to do.
I'd suggest to checkout the repository, then go to one of the examples directory (ex1, ex2) and there run make.

If you're running this on Windows check if git has checked out with correct line ending and has created correctly symbolic links (in the examples in the repository Makefiles are symbolic links to the file in mk directory and also Rules.top in ex1/ex2 are symlinks - I've seen that some versions of git on Windows instead of creating proper symlink are just creating plain file with contents being the path where the symlink should point to, if that happens then just overwrite it with the contents of the file where it should point).

Once you check all this run make in one of the examples directory and let me know if there were any problems.

PS. "Pure" Windows are not supported - I hope you're using cygwin or mingw.

commented

I was sure you are right!
I got a cygwin.I got it right.
But:
LINK obj/debug/app
/usr/bin/ld: cannot find -ldir3
I think it's the libdir3.so that ld can't find
How to do?(I run make in ex1.)

Could you run with verbose output ('make VERBOSE=yes') and paste here the output?

commented

Ok,here:
Administrator@PC-201406111817 /cygdrive/f/Work/nonrec-make/ex1
$ make VERBOSE=yes
/bin/bash: tput: command not found
/bin/bash: line 0: [: -gt: unary operator expected
Rules generated for "debug" mode...
CC top_a.c
CC top_b.c
CC main.c
CC Dir_1/dir_1_file1.c
CC Dir_1/dir_1_file2.c
CC Dir_1/dir_1_file3.c
CC Dir_1/Dir_1a/dir_1a_file1.c
CC Dir_1/Dir_1a/dir_1a_file2.c
CC Dir_1/Dir_1a/dir_1a_file3.c
CC Dir_1/Dir_1b/src/dir_1b_file1.c
CC Dir_1/Dir_1b/src/dir_1b_file2.c
CC Dir_3/dir_3_file1.c
/cygdrive/f/Work/nonrec-make/ex1/Dir_3/dir_3_file1.c:1:0: 警告:-fPIC ignored for target (all code is position independent) [默认启用]
void function_dir_3_file1(void)
^
CC Dir_3/dir_3_file2.c
/cygdrive/f/Work/nonrec-make/ex1/Dir_3/dir_3_file2.c:1:0: 警告:-fPIC ignored for target (all code is position independent) [默认启用]
void function_dir_3_file2(void)
^
LINK Dir_3/obj/debug/libdir3.so
AR Dir_1/obj/debug/dir1_lib.a
ar: 正在创建 /cygdrive/f/Work/nonrec-make/ex1/Dir_1/obj/debug/dir1_lib.a
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/obj/debug/dir_1_file1.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/obj/debug/dir_1_file2.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/obj/debug/dir_1_file3.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/Dir_1a/obj/debug/dir_1a_file1.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/Dir_1a/obj/debug/dir_1a_file2.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/Dir_1a/obj/debug/dir_1a_file3.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/Dir_1b/obj/debug/dir_1b_file1.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_1/Dir_1b/obj/debug/dir_1b_file2.o
CC Dir_2/dir_2_file1.c
CC Dir_2/dir_2_file2.c
CC Dir_2/Dir_2a/dir_2a_file1.c
CC Dir_2/Dir_2a/dir_2a_file2.c
CC Dir_2/Dir_2a/dir_2a_file3.c
CC Dir_2/Dir_2b/dir_2b_file2.c
CC Dir_2/Dir_2b/dir_2b_file3.c
CC Dir_2/Dir_2b/dir_2b_file1.c
AR Dir_2/obj/debug/dir2_lib.a
ar: 正在创建 /cygdrive/f/Work/nonrec-make/ex1/Dir_2/obj/debug/dir2_lib.a
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/obj/debug/dir_2_file1.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/obj/debug/dir_2_file2.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/Dir_2a/obj/debug/dir_2a_file1.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/Dir_2a/obj/debug/dir_2a_file2.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/Dir_2a/obj/debug/dir_2a_file3.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/Dir_2b/obj/debug/dir_2b_file2.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/Dir_2b/obj/debug/dir_2b_file3.o
a - /cygdrive/f/Work/nonrec-make/ex1/Dir_2/Dir_2b/obj/debug/dir_2b_file1.o
LINK obj/debug/app
/usr/bin/ld: cannot find -ldir3
collect2: 错误:ld 返回 1
Makefile:45: recipe for target '/cygdrive/f/Work/nonrec-make/ex1/obj/debug/app' failed
make: *** [/cygdrive/f/Work/nonrec-make/ex1/obj/debug/app] Error 1

My apologies, the actual command is 'make VERBOSE=true' (not 'yes') and please paste only the output starting with the failing line (linking obj/debug/app - I'm interested in the set of '-L' switches passed to linker since it is failing to find libdir3.dll.

Actually I also have noticed something strange. In the above output I see 'LINK Dir_3/obj/debug/libdir3.so' whereas on Cygwin shared libraries have 'dll' extension. Could you also paste output of 'uname -s' and 'uname -m'. These commands are used for detection of architecture/machine and later relevant config-*.mk are included. In config-Cygwin-i686_Cygwin-i686.mk there is defined SOEXT as 'dll' so it should be 'LINK Dir_3/obj/debug/libdir3.dll' (not with .so extension like in your output).

commented

g++ -g -W -Wall -ggdb -MMD -D_REENTRANT -D_POSIX_C_SOURCE=200112L -D__EXTENSIONS__ -DDEBUG -DLITTLE_ENDIAN -ggdb /cygdrive/f/Work/nonrec-make/ex1/obj/debug/top_a.o /cygdrive/f/Work/nonrec-make/ex1/obj/debug/top_b.o /cygdrive/f/Work/nonrec-make/ex1/obj/debug/main.o /cygdrive/f/Work/nonrec-make/ex1/Dir_1/obj/debug/dir1_lib.a /cygdrive/f/Work/nonrec-make/ex1/Dir_2/obj/debug/dir2_lib.a -L/cygdrive/f/Work/nonrec-make/ex1/Dir_3/obj/debug/ -ldir3 -lm -o /cygdrive/f/Work/nonrec-make/ex1/obj/debug/app
/usr/bin/ld: cannot find -ldir3

CYGWIN_NT-6.1
x86_64

Is there something wrong in the possiblity?


魅影~圣域

------------------ 原始邮件 ------------------
发件人: "aostruszka"notifications@github.com;
发送时间: 2014年9月16日(星期二) 晚上6:39
收件人: "aostruszka/nonrec-make"nonrec-make@noreply.github.com;
抄送: "魅影圣域"805600352@qq.com;
主题: Re: [nonrec-make] not a layer?socute (#19)

My apologies, the actual command is 'make VERBOSE=true' (not 'yes') and please paste only the output starting with the failing line (linking obj/debug/app - I'm interested in the set of '-L' switches passed to linker since it is failing to find libdir3.dll.

Actually I also have noticed something strange. In the above output I see 'LINK Dir_3/obj/debug/libdir3.so' whereas on Cygwin shared libraries have 'dll' extension. Could you also paste output of 'uname -s' and 'uname -m'. These commands are used for detection of architecture/machine and later relevant config-*.mk are included. In config-Cygwin-i686_Cygwin-i686.mk there is defined SOEXT as 'dll' so it should be 'LINK Dir_3/obj/debug/libdir3.dll' (not with .so extension like in your output).


Reply to this email directly or view it on GitHub.

commented

possibility

OK, it looks like you're using 64-bit windows and there is no config specific for this platform yet.
Looking at the contents of Cygwin/i686 there seems to be nothing specific for i686 so please go to your mk/ directory and make a symlink config-Cygwin-x86_64_Cygwin-x86_64.mk pointing to that i686 config. Then run again (optionally preceded by 'make clean') and let me know if it solves your build problem.

Just as a confirmation of the diagnosis you can take a look at Dir_3/obj/debug and there should be libdir3.so (instead of libdir3.dll which is expected by the cygwin linker when it is given -ldir3).

I hope that resolves your problems

  • if so, you can just take a look at the structure of Rules.{mk,top} and wiki pages to see how to adapt them to your needs
  • if not, then let me know and we'll work on it together

Regards
Andrzej

commented

got it------------------ 原始邮件 ------------------
发件人: "aostruszka"notifications@github.com
发送时间: 2014年9月16日(星期二) 晚上7:54
收件人: "aostruszka/nonrec-make"nonrec-make@noreply.github.com;
抄送: "mysyljr"805600352@qq.com;
主题: Re: [nonrec-make] not a layer?socute (#19)

OK, it looks like you're using 64-bit windows and there is no config specific for this platform yet.
Looking at the contents of Cygwin/i686 there seems to be nothing specific for i686 so please go to your mk/ directory and make a symlink config-Cygwin-x86_64_Cygwin-x86_64.mk pointing to that i686 config. Then run again (optionally preceded by 'make clean') and let me know if it solves your build problem.

Just as a confirmation of the diagnosis you can take a look at Dir_3/obj/debug and there should be libdir3.so (instead of libdir3.dll which is expected by the cygwin linker when it is given -ldir3).

I hope that resolves your problems

if so, you can just take a look at the structure of Rules.{mk,top} and wiki pages to see how to adapt them to your needs

if not, then let me know and we'll work on it together

Regards
Andrzej


Reply to this email directly or view it on GitHub.

commented

you are right again.
I did so and, success.
can you tell me the reason inside?
I have a question about xxx.d files.I opened another issue.

commented

if you don't want say much here,can you send me email to let me understand?805600352@qq.com

commented

SRCS_VPATH is misleading because it's not one-per-dir,and if I set it in one dir,I let another dir fail.So why shouldn't SRCS_VPATH be implemented to be one-per-dir?