what is "bin/vc" in Linux? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: December 21, 2018, 03:26:19 pm
content: I am trying to recompile a compiler which is experimental so it hasn't yet documentation.In the Makefile I find thisCode:all: bin/vc bin/vprof bin/xcc$(TARGET) #bin/vcppbut my rootfs doesn't have any bin/vc, and I wonder what it is ...any clue?

author: langwadt
author_rank: Super Contributor
timestamp: December 21, 2018, 03:40:50 pm
content: Quote from: legacy on December 21, 2018, 03:26:19 pmhttp://sun.hasenbraten.de/vbcc/?

author: legacy
author_rank: Super Contributor
timestamp: December 21, 2018, 04:03:09 pm
content: no

author: rstofer
author_rank: Super Contributor
timestamp: December 21, 2018, 04:07:58 pm
content: Code:all: bin/vc bin/vprof bin/xcc$(TARGET) #bin/vcppThe make target 'all' is supposed to create objects files vc, vprog and xcc$(TARGET) and place them in the ./bin directory. In the end, bin/vc should exist as an executable file (I think). I don't know if the directories need to exist before invoking make.Somewhere in that makefille there will be instructions on how to actually make bin/vc

author: legacy
author_rank: Super Contributor
timestamp: December 21, 2018, 04:17:20 pm
content: Quote from: rstofer on December 21, 2018, 04:07:58 pmeh, it isn't so easy: the Makefile doesn't create bin/vc because there is no instruction to create it, thus it assumes it's already existing. And I have no idea what it is.

author: bsudbrink
author_rank: Frequent Contributor
timestamp: December 21, 2018, 04:17:51 pm
content: Regardless, do note that the reference is relative to the location of the makefile and not root as your original post implied.

author: legacy
author_rank: Super Contributor
timestamp: December 21, 2018, 04:48:01 pm
content: Quote from: bsudbrink on December 21, 2018, 04:17:51 pmCorrect, it's local, and locally there is no bin folder (I have double checked the directory structure).I guess I have to contact the author, I am out of ideasThis compiler might also be "derived" from another project (which makes sense since I am on an experimental ISA-core), which is what it smells at this point ... (what a mess)

author: Canis Dirus Leidy
author_rank: Regular Contributor
timestamp: December 21, 2018, 05:11:20 pm
content: I can't be sure, but it looks likeC compiler from Plan9:QuoteQuote

author: rstofer
author_rank: Super Contributor
timestamp: December 21, 2018, 07:53:37 pm
content: To be more specific, the target 'all' depends on the existence of ./bin/vc, et al. Usually the makefile will create those files as if they are the targets but it might just be a test to make sure they already exist and the building of the actual targets is on the next line in the Makefile.Post more of the file.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 23, 2018, 11:49:32 pm
content: Consider the followingMakefile:Code:CC := gccCFLAGS := -Wall -O2LDFLAGS := -lm.PHONY: all properall: bin/vc bin/fooproper:rm -rf binbin/%: src/%.c@mkdir -p bin$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@The.PHONY: all properline is optional, and can be safely omitted. I mostly keep them because they tell the human developers which targets do not create any files.When you runmake, it creates thebin/subdirectory if needed, and then compilessrc/vc.cinto a binary executablebin/vc, andsrc/foo.cintobin/foo. This is becauseallis the default target, as it is listed first.If you runmake proper, thebin/subdirectory is deleted. You can runmake proper allto rebuild all binaries from scratch.If you do not use GCC, you can run saymake CC=cc CFLAGS= LDFLAGS= proper allto rebuild all binaries from scratch usingccas your C compiler, without any compiler build or link options at all.

author: legacy
author_rank: Super Contributor
timestamp: December 24, 2018, 12:00:40 am
content: I know HOW a Makefile works*The* point WAS that the Makefile in the project I got has no single line about creating anything called bin/vc and I have no idea what was in the head of his author, and I believed it was an external program that he wanted to put in a local bin/ folder checking for its existence.In fact, there is no bin/vc, no rule about creating it, and it fails.No I am rebuilding the whole project from scratch starting from its AST and parser (this part of the Makefile does no need any bin/vc), because it's really a mess, in fact, there are also a lot of problems at detecting the endianness and the data size of types ("int" is ? 16bit or 32bit? the autotest fails )

author: malagas_on_fire
author_rank: Frequent Contributor
timestamp: December 24, 2018, 12:16:47 am
content: Sorry i may talk crap but the question resides on the origin of the "vc" binary if one . right?I've found something about speech synthesis toolkit:https://github.com/r9y9/SPTKhttps://github.com/r9y9/SPTK/tree/master/bin/vcAgain it could not correspond to the same vc binary. or source code implied.

author: rstofer
author_rank: Super Contributor
timestamp: December 24, 2018, 12:53:23 am
content: Quote from: legacy on December 24, 2018, 12:00:40 amYou could domd bin,cd binandtouch vcto create an empty file. The Makefile will be satisfied with the dependency and unless vc is actually used as a compiler in the Makefile, everything should go fine. It's not like you're trying to create an updated version of vc.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 24, 2018, 02:21:22 am
content: Quote from: legacy on December 24, 2018, 12:00:40 amMy point: neither does that example Makefile. Unless you count the generic recipe. It could get created from some obscure recipe, and only in some specific situations. I wanted to show a typical pattern to look for.Quote from: legacy on December 24, 2018, 12:00:40 amThat makes absolutely no sense. I've never seen a Makefile that does that, and I've looked at thousands of them, both open source and cobbled together by scientists. If you look at environments where there are alternate sets of tools one might have to choose at build time, they are almost always controlled via environment variables; usually viaPATHet al.Quote from: legacy on December 24, 2018, 12:00:40 amDid it ever compile on any system, to your knowledge? That would have been my first step, rather than making outrageous guesses about it being a Linux issue.(By "outrageous", I mean as in provocative; with no logical connection to observations. There is probably a better word for it, but me fail English.)Quote from: rstofer on December 24, 2018, 12:53:23 amI do use a roughly similar pattern when building a project requires additional compile-time tools, although I tend to use bash and/or awk for those. In my case, I do use a variable to name it, rather than hardcode it, because the variable is easier to track in the Makefile.The important questions areIsvcorbin/vcused in the recipes?Are there other makefiles (often named*.mk) included or executed in a subdirectory, that could generatevcorbin/vc?Sub-makefiles are usually executed using$(MAKE) -Cdirectory-ffilename, and makefile fragments included using theincludedirective.Some projects do require a specific command, for examplemake -f linux.mk tools, to generate build-time tool symlinks and/or scripts, prior to a proper build.

author: legacy
author_rank: Super Contributor
timestamp: December 24, 2018, 11:30:30 am
content: The author replied yesterday night and ... it's written nowhere (there is no readme/doc/whatever), but his tarball needs to be uncompressed inside a folder *on the top of another existing project*. So it was a sort of differential tarball that overrides some filesGood news, now I now bin/vc is not a Linux program, it's something built and I also have a "new Makefile" that tells how it's built.QuoteIn the tar.gz file I originally got ... it was "makefile" ("m" instead of "M", which reports no rule like the above)So to compile the wholestep1: make -f Makefile ----> builds bin/vcstep2: make -f makefile ----> checks for bin/vc and builds obj/cc (the experimental core I am looking at)Ok, now it makes sense, but it doesn't compile yet: now I have to understand and solve problems related to the endian type which are not correctly detected, and the process fails. It seems this compiler has never been compiled on a host data types = 32bit/BigEndian, which is what you find in a machine like an Apple PowerPC.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 24, 2018, 12:23:18 pm
content: Quote from: legacy on December 24, 2018, 11:30:30 amActually... I've seen that before. (Researchers who have taught themselves to program... The complete lack of documentation is also typical. If it is not publishable in a journal, they tend to not bother. I know of software bugs that "cannot" be fixed, because doing so would mean small but measurable changes to published results. Which might affect their reputation. So they're not bugs, just "features".)Quote from: legacy on December 24, 2018, 11:30:30 amThat's just downright evil.Thanks for letting us know, by the way: knowing about these weird/evil cases may save quite a bit of time in the future, if one has to work with a similarly, ah, "quirky", codebase.(In reality, I mean one can recognise the signs early, and instead of eventually ripping ones eyes out in frustration, burn it with fire and restart from scratch.)