zsaleeba / picoc

A very small C interpreter
1.45k stars 183 forks source link

svnversion -n not handled #2

Open wbhart opened 9 years ago

wbhart commented 9 years ago

When I try to "make" picoc on Ubuntu, this is the result:

   wbhart@hilbert:~/picoc$ make
   gcc -Wall -pedantic -g -DUNIX_HOST -DVER=\"`svnversion -n`\"   -c -o picoc.o picoc.c
   gcc: error: directory": No such file or directory
   make: *** [picoc.o] Error 1

Here is the output of svnversion -n:

   wbhart@hilbert:~/picoc$ svnversion -n
   Unversioned directorywbhart@hilbert:~/picoc$
ShonFrazier commented 9 years ago

Identical problem on OS X v 10.10.3. Output as above:

shon@atlas ~/D/P/picoc> make
gcc -Wall -pedantic -g -DUNIX_HOST -DVER=\"`svnversion -n`\"   -c -o picoc.o picoc.c
clang: error: no such file or directory: 'directory"'
make: *** [picoc.o] Error 1

shon@atlas ~/D/P/picoc> svnversion -n
Unversioned directory⏎
meriororen commented 9 years ago

Same here. (Ubuntu)

[picoc] make
gcc -Wall -pedantic -g -DUNIX_HOST -DVER=\"`svnversion -n`\"   -c -o picoc.o picoc.c
gcc: error: directory: No such file or directory
make: *** [picoc.o] Error 1
[picoc] svnversion -n
Unversioned directory%      
e8johan commented 9 years ago

I just created a pull request that replaces this with the git hash.

pepa65 commented 9 years ago

Same here; fine after -DVER=\"1\"

zsaleeba commented 9 years ago

Ah yes, sorry I haven't updated this since the github switch. My bad.

darked89 commented 9 years ago

I just removed the -DVER=\"svnversion -n\" from the Makefile so it compiles on Lubuntu 15.04 ( gcc 4.9.2). The make test finishes without an error, and ./picoc -i reports version: v2.2. I find it confusing that code from github seems to require svn to build. And if I did install svn, it still did not build.

Anyway, thanks for writing the picoc in the first place :).

Darek Kedra

anqurvanillapy commented 8 years ago
-DVER=\"`svnversion -n`\"
iam070 commented 7 years ago

if you have the problem shown below

gcc -Wall -pedantic -g -DUNIX_HOST -DVER=\"`svnversion -n`\"   -c -o picoc.o picoc.c
gcc: error: directory": No such file or directory
make: *** [<builtin>: picoc.o] Error 1

You can just modify Makefile just like this

diff --git a/Makefile b/Makefile
index 6e01a17..abeacea 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-Wall -pedantic -g -DUNIX_HOST -DVER=\"`svnversion -n`\"
+CFLAGS=-Wall -pedantic -g -DUNIX_HOST -DVER=\"SOME_VER_NUMBER\"
 LIBS=-lm -lreadline

 TARGET = picoc