Discussion:
[Slackbuilds-users] how can i define data_dir in makefile?
Fernando Lopez
2018-08-21 17:29:27 UTC
Permalink
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src dir"*

this is how i am doing it:

make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
--
------------
Regards,
Fernando Lopez Jr.
David Woodfall
2018-08-21 17:31:29 UTC
Permalink
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src dir"*
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
Try putting in front of make or exporting it:

DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
Post by Fernando Lopez
If you don't need X then little VT-100 terminals are available for real
cheap. Should be able to find decent ones used for around $40 each.
For that price, they're a must for the kitchen, den, bathrooms, etc.. :)
You're right. Can you explain this to my wife?
-- Seen on c.o.l.development.system, on the subject of extra terminals

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-***@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
Fernando Lopez
2018-08-21 17:33:45 UTC
Permalink
didnt work. =\
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src dir"*
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
Post by Fernando Lopez
If you don't need X then little VT-100 terminals are available for real
cheap. Should be able to find decent ones used for around $40 each.
For that price, they're a must for the kitchen, den, bathrooms, etc.. :)
You're right. Can you explain this to my wife?
-- Seen on c.o.l.development.system, on the subject of extra terminals
.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
--
------------
Regards,
Fernando Lopez Jr.
David Woodfall
2018-08-21 17:37:00 UTC
Permalink
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
You could try:

export DATA_DIR=bla

But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.

-Dave

Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src dir"*
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
--

How do I type "for i in *.dvi do xdvi $i done" in a GUI?
-- Discussion in comp.os.linux.misc on the intuitiveness of interfaces

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-***@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
David Woodfall
2018-08-21 17:44:25 UTC
Permalink
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.

-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src dir"*
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--

One of the things that hamper Linux's climb to world domination is the
shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
can be considered respectable without one.
-- Brian O'Donnell, ***@tcd.ie

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-***@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
Fernando Lopez
2018-08-21 18:06:50 UTC
Permalink
not working... not working =\
Post by David Woodfall
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.
-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src
dir"*
Post by David Woodfall
Post by Fernando Lopez
Post by David Woodfall
Post by Fernando Lopez
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
One of the things that hamper Linux's climb to world domination is the
shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
can be considered respectable without one.
.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
--
------------
Regards,
Fernando Lopez Jr.
Matteo Bernardini
2018-08-21 18:20:14 UTC
Permalink
Fernando, when you are asking for help you should put a link to the
sources that you are trying to build, if it's not clear which ones:
are they these?

https://github.com/zombieCraig/ICSim

if they are I just cloned it here and run a simple command

$ grep -r DATA_DIR
controls.c:#ifndef DATA_DIR
controls.c:#define DATA_DIR "./data/"
controls.c:#define DEFAULT_CAN_TRAFFIC DATA_DIR "sample-can.log"
controls.c: if(strlen(DATA_DIR) + strlen(fname) > 255) return NULL;
controls.c: strncpy(data_file, DATA_DIR, 255);
icsim.c:#ifndef DATA_DIR
icsim.c:#define DATA_DIR "./data/" // Needs trailing slash
icsim.c: if(strlen(DATA_DIR) + strlen(fname) > 255) return NULL;
icsim.c: strncpy(data_file, DATA_DIR, 255);
icsim.c: if(stat(DATA_DIR, &dirstat) == -1) {
icsim.c: printf("ERROR: DATA_DIR not found. Define in make
file or run in src dir\n");

the Makefile is this

CC=gcc
CFLAGS=-I/usr/include/SDL2
LDFLAGS=-lSDL2 -lSDL2_image

all: icsim controls

icsim: icsim.o lib.o
$(CC) $(CFLAGS) -o icsim icsim.c lib.o $(LDFLAGS)

controls: controls.o
$(CC) $(CFLAGS) -o controls controls.c $(LDFLAGS)

lib.o:
$(CC) lib.c

clean:
rm -rf icsim controls icsim.o controls.o

this is a very basic software still in a very early stage.

if you want to build using your CFLAGS and adding a DATA_DIR you
should edit the Makefile before building usind sed, adding a line like
this

DATA_DIR=/usr/share/icsim

after the LDFLAGS one in the Makefile and modifying the CFLAGS one
adding $SLKCFLAGS (expanded).
_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-***@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
Gabriel Diaz
2018-08-21 18:21:21 UTC
Permalink
hello

in the source code of icsim.c there is a

#ifndef DATA_DIR
#define DATA_DIR "./data/" // Needs trailing slash
#endif


and then


if(stat(DATA_DIR, &dirstat) == -1) {
printf("ERROR: DATA_DIR not found. Define in make file or run in src dir\n");
exit(34);
}

so if there is no DATA_DIR defined, you might try to create a "data" diretory on the same path youÂŽre running icsim.


another option is to add -DDATA_DIR=/var/lib/iscsim or something like that to the CFLAGS so the DATA_DIR is defined to your liking.

probably a good option is to define -DDATA_DIR in the CFLAGS and instruct the buildscript to define a DATA_DIR variable by default or pick one from the environment.

my 2 cents.

gabi


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Post by Fernando Lopez
not working... not working =\
Post by David Woodfall
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.
-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found.  Define in make file or run in src dir"*
make \
   CFLAGS="$SLKCFLAGS" \
   DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
One of the things that hamper Linux's climb to world domination is the
shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
can be considered respectable without one.
                                                            .--.  oo
                                                           (____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
--
------------
Regards,
    Fernando Lopez Jr.
David Spencer
2018-08-21 19:02:33 UTC
Permalink
Hi,
gabi gets my vote :D
-D.
Post by Gabriel Diaz
hello
in the source code of icsim.c there is a
#ifndef DATA_DIR
#define DATA_DIR "./data/" // Needs trailing slash
#endif
and then
if(stat(DATA_DIR, &dirstat) == -1) {
printf("ERROR: DATA_DIR not found. Define in make file or run in src dir\n");
exit(34);
}
so if there is no DATA_DIR defined, you might try to create a "data" diretory on the same path you´re running icsim.
another option is to add -DDATA_DIR=/var/lib/iscsim or something like that to the CFLAGS so the DATA_DIR is defined to your liking.
probably a good option is to define -DDATA_DIR in the CFLAGS and instruct the buildscript to define a DATA_DIR variable by default or pick one from the environment.
my 2 cents.
gabi
Fernando Lopez
2018-08-21 18:15:59 UTC
Permalink
help
Post by Fernando Lopez
not working... not working =\
Post by David Woodfall
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.
-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src
dir"*
Post by David Woodfall
Post by Fernando Lopez
Post by David Woodfall
Post by Fernando Lopez
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
One of the things that hamper Linux's climb to world domination is the
shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
can be considered respectable without one.
.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
--
------------
Regards,
Fernando Lopez Jr.
--
------------
Regards,
Fernando Lopez Jr.
Fernando Lopez
2018-08-21 18:18:28 UTC
Permalink
help

https://www.dropbox.com/s/lxx4qg3fb1vnsz1/ICSim.tar.bz2?dl=0
Post by David Woodfall
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.
-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src
dir"*
Post by David Woodfall
Post by Fernando Lopez
Post by David Woodfall
Post by Fernando Lopez
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
One of the things that hamper Linux's climb to world domination is the
shortage of bad Computer Role Playing Games, or CRaPGs. No operating system
can be considered respectable without one.
.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
--
------------
Regards,
Fernando Lopez Jr.
David Woodfall
2018-08-21 18:36:13 UTC
Permalink
On Tuesday 21 August 2018 12:18,
Post by Fernando Lopez
help
https://www.dropbox.com/s/lxx4qg3fb1vnsz1/ICSim.tar.bz2?dl=0
Did you actually create the directory? It looks like you need to do
that as well as set the variable.

-Dave
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.
-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src
dir"*
Post by David Woodfall
Post by Fernando Lopez
Post by David Woodfall
Post by Fernando Lopez
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--

Once upon a time there was a DOS user who saw Unix, and saw that it was
good. After typing cp on his DOS machine at home, he downloaded GNU's
unix tools ported to DOS and installed them. He rm'd, cp'd, and mv'd
happily for many days, and upon finding elvis, he vi'd and was happy. After
a long day at work (on a Unix box) he came home, started editing a file,
and couldn't figure out why he couldn't suspend vi (w/ ctrl-z) to do
a compile.
-- Erik Troan, ***@tipper.oit.unc.edu

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-***@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
Fernando Lopez
2018-08-21 18:36:42 UTC
Permalink
yes i am creating it on the package itself...
Post by David Woodfall
On Tuesday 21 August 2018 12:18,
Post by Fernando Lopez
help
https://www.dropbox.com/s/lxx4qg3fb1vnsz1/ICSim.tar.bz2?dl=0
Did you actually create the directory? It looks like you need to do
that as well as set the variable.
-Dave
Post by Fernando Lopez
Post by David Woodfall
On Tuesday 21 August 2018 18:37,
Post by David Woodfall
On Tuesday 21 August 2018 11:33,
Post by Fernando Lopez
didnt work. =\
export DATA_DIR=bla
But it does say to put it in the make file, so maybe you'll have to
sed it in or make a patch.
By the way, CFLAGS="$SLKCFLAGS" \ ought to be before the make command
anyway.
-Dave
Post by David Woodfall
-Dave
Well it does say to put it in the makefile
Post by Fernando Lopez
On Tue, Aug 21, 2018 at 11:31 AM David Woodfall <
Post by David Woodfall
On Tuesday 21 August 2018 11:29,
Post by Fernando Lopez
this is the error i get when i run my program...
*"ERROR: DATA_DIR not found. Define in make file or run in src
dir"*
Post by David Woodfall
Post by Fernando Lopez
Post by David Woodfall
Post by Fernando Lopez
make \
CFLAGS="$SLKCFLAGS" \
DATA_DIR=$PKG/usr/share/icsim
DATA_DIR=bla \
CFLAGS="$SLKCFLAGS" \
make
--
Once upon a time there was a DOS user who saw Unix, and saw that it was
good. After typing cp on his DOS machine at home, he downloaded GNU's
unix tools ported to DOS and installed them. He rm'd, cp'd, and mv'd
happily for many days, and upon finding elvis, he vi'd and was happy.
After
a long day at work (on a Unix box) he came home, started editing a file,
and couldn't figure out why he couldn't suspend vi (w/ ctrl-z) to do
a compile.
.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
_______________________________________________
SlackBuilds-users mailing list
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/
--
------------
Regards,
Fernando Lopez Jr.
Loading...