Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Building a Native Library - GCC Tool Chain
Page 2 of 2

PostPosted: Sat Jan 10, 2004 8:30 pm
by jstadolnik
I found the culprit. Use the following lines to do the final build-prc call.

Code: Select all
$(LIBNAME).prc: $(LIBNAME) libr0000.$(LIBNAME).grc
   $(BUILDPRC) $@ $(LIBNAME) $(CREATOR) -v $(VERSION) $^


Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm

PostPosted: Sat Jan 10, 2004 8:45 pm
by cable_guy_67
Worked like a champ, what did I manage to build earlier today, a shared library as opposed to a native one? There is about a 4k difference in size. The one I built earlier was 2.72kb and the one with your last change was 6.69kb. Same compiler options just the difference with the -L -t libr. One other thing. If you run "make clean" and then "make" you get a report that there is no rule to make the xGrfxLib.o needed by xGrfxLib. I added some lines to take care of this. I don't know why the %.o : %.cpp rule didn't take care of that but, I can honestly say I don't totally grasp the use of '%'.

make documentation section 6.11:
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">where pattern is a %-pattern. As with target-specific variable values, multiple pattern values create a pattern-specific variable value for each pattern individually. The variable-assignment can be any valid form of assignment. Any command-line variable setting will take precedence, unless override is specified.

For example:

%.o : CFLAGS = -O

will assign CFLAGS the value of `-O' for all targets matching the pattern %.o. <hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Looks like I will just have to do more studying. ;)

Section I changed:
Code: Select all
#%.o : %.cpp $(LIBNAME).h
#   $(CC) -c $<

$(LIBNAME).o: $(LIBNAME).cpp
   $(CC) -c $(LIBNAME).cpp

$(LIBNAME)Dispatch.o: $(LIBNAME)Dispatch.cpp
   $(CC) -c $(LIBNAME)Dispatch.cpp


Thanks again for all the help Joe, I just sat back down to clean up all the work we did over the last day and hope to have it bundled with explanations by tonite or tomorrow. Should I send it up to Jeremy and ask him if he wants to put it on the resource page. The origonal author of xGrfx left it to die. I will send him an email and let him know it has been updated for the latest tool chain.

Mark

PostPosted: Sun Jan 11, 2004 2:10 am
by jstadolnik
Given the smaller size I would definitely use the -L switch (the -L and the -t libr switches do the same thing), rather than not. I'm not sure why there is a size difference.

For the PToolboxLib I don't use the -L switch because I'm building an application which happens to have a library embedded in it. I must have copied the PToolboxLib makefile over to the test makefile long ago and forgot about the -L switch.

Anyways, I did run a test to see if compiling the PToolbox with -L had any impact, but it had no effect.

BTW: %.o means "for all targets ending in .o".

Below is a much streamlined makefile. PRC-Tools has advanced quite a bit over the past few years allowing for this simplication. Note that the below makefile includes support for the new floating point manager and PalmOS glue libraries (see the XTRALIBS macro).

Joe

----

Code: Select all
LIBNAME = TestLib
CREATOR = XXXX

OBJECTS = $(LIBNAME).o $(LIBNAME)Dispatch.o

CC = m68k-palmos-gcc -O2

XTRALIBS = -lnfm -lgcc -lPalmOSGlue
BUILDPRC = build-prc

main : $(LIBNAME).prc size

#build the PRC
$(LIBNAME).prc: $(LIBNAME)
   $(BUILDPRC) -L $@ $(LIBNAME) $(CREATOR) $^

#build library intermediate file
$(LIBNAME): $(OBJECTS) Makefile
   $(CC) -shared -nostartfiles -nostdlib -o $(LIBNAME) $(OBJECTS) $(XTRALIBS)

#generic rule for building .o files from respective .cpp files
%.o : %.cpp $(LIBNAME).h
   $(CC) -c $<

mostly_clean:
   rm -f *.o $(LIBNAME)

clean: mostly_clean
   rm -f $(LIBNAME).prc

size:
   @ls -l $(LIBNAME).prc


The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm

PostPosted: Sun Jan 11, 2004 2:44 am
by cable_guy_67
Joe, working with the makefile you just posted and changing the name of the libfile in LIBNAME:

If I first clean the work area with:
Code: Select all
$ make clean
rm -f *.o xGrfxLib
rm -f xGrfxLib.prc

And then 'make' I get:
Code: Select all
$ make
make: *** No rule to make target `xGrfxLib.o', needed by `xGrfxLib'.  Stop.

But if I add to the Makefile:
Code: Select all
$(LIBNAME).o: $(LIBNAME).cpp
   $(CC) -c $(LIBNAME).cpp

$(LIBNAME)Dispatch.o: $(LIBNAME)Dispatch.cpp
   $(CC) -c $(LIBNAME)Dispatch.cpp

And then 'make' everything runs fine. I wonder if it is something here locally. Thanks so much for all the help. I appreciate the time you loaned me. Let me know if I can pay back the favor.

Mark

PostPosted: Sun Jan 11, 2004 3:03 am
by jstadolnik
Odd, it works for me. Ooooh...

In your autoexec.bat file add the following line and re-boot:

SET MAKE_MODE=UNIX

That should fix the wildcarding.

There's a blurb about this here (last entry): http://www.ardiri.com/index.php?redir=p ... subcat=faq

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm

PostPosted: Sun Jan 11, 2004 3:16 am
by cable_guy_67
I already have that set. You know it could be as simple as me not having all the CR/LF's stripped from the makefile. I will run it through the proper editor in the morning. I owe you. Next step to make a template for my IDE and all will be well. Then the joy of tranferring my PocketC code to C++ for my own library and the world will be a shiny happy place. Have a good weekend.

Mark

THREAD COMPLETE

Tutorial followup will be sent to Jeremy.

PostPosted: Sun Jan 11, 2004 8:40 pm
by cable_guy_67
Changed line in Makefile following make documentation:
make section 4.12.1
Code: Select all
#generic rule for building .o files from respective .cpp files
$(OBJECTS) : %.o: %.cpp $(LIBNAME).h
   $(CC) -c $<


Works well now. It wasn't the MAKE_MODE = UNIX nor the CR/LF problem I thought it might be.

Mark

PostPosted: Mon Jan 12, 2004 8:04 pm
by cable_guy_67
Finally I figured out the problem I was haveing with the rule:

%.o : %.cpp

It seems that my sh in /bin was not bash. Some other program that gave me gobbledegoop when I ran it from a bash prompt. Just made a copy of bash after renaming the old sh.exe and saved the extra copy of bash as sh.exe. Something to do with non-interactive shells or something of that ilk. I have changed the Makefile back to your original design Joe. Works fine.

Makefile is now complete. I noticed you made the changes in the previous post reguarding the floating point library support switches and now I am running that version of the Makefile.

Code: Select all
#generic rule for building .o files from respective .cpp files
$(OBJECTS) : %.o: %.cpp $(LIBNAME).h
   $(CC) -c $<

becomes:
Code: Select all
#generic rule for building .o files from respective .cpp files
%.o: %.cpp $(LIBNAME).h
   $(CC) -c $<


Mark