Build problems with autogen. makefiles under Linux

Discussions about osFree boot sequence
Post Reply
admin
Site Admin
Posts: 1925
Joined: Wed Dec 19, 2018 9:23 am
firstname: osFree
lastname: admin

Build problems with autogen. makefiles under Linux

Post by admin »

Viking, Posted: Dec 07, 2008 11:53:44 am:

Hi!

I'm having big troubles with makefile generation under Linux because the character '$'
is special to the shell (bash).

I have tried to wrap them inside double quotes but still it does not work. So I'm trying
to create a simpler makefile gen. script in REXX. But I would need to see a working makefile
to be sure it works. So could anyone upload a working makefile from, say:

osfree/build/bootseq/loader/filesys

From the build directory?

There is also problems sending argument through Regina where I have to use the switch '-a'
which makes it keep arguments as they are given to the script. How does that work with
cmd.exe in OS/2?

Greetings Viking
admin
Site Admin
Posts: 1925
Joined: Wed Dec 19, 2018 9:23 am
firstname: osFree
lastname: admin

Re: Build problems with autogen. makefiles under Linux

Post by admin »

prokushev, Posted: Dec 10, 2008 5:19:14 am:

Hello.

I'm slightly don't understand about which generation you talk? In build directory?

wbr,
Yuri
admin
Site Admin
Posts: 1925
Joined: Wed Dec 19, 2018 9:23 am
firstname: osFree
lastname: admin

Re: Build problems with autogen. makefiles under Linux

Post by admin »

valerius, Posted: Dec 11, 2008 12:36:48 am:

2Viking: sorry if I am answering to late (or, the dates on the forum are again wrong?) --
I checked the new messages at the osFree main page, there isn't something new here.

Yes, the '$' character is special to shell (and wmake too), so, I repeated it twice. If it
substitutes two times, it was repeated 4 times ('$$$$'). Does repeating not work in unix
shell? Maybe, escaping by the backslash will work or something?

OK, this is the generated makefile from osfree/build/bootseq/loader/filesys:
#
# This is auto-generated file,
# don't edit!
#

!include varsrcos2svnosfreebootseqloaderfilesysmakefile

fat_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_fat.$(O)

ext2fs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_ext2fs.$(O)

jfs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_jfs.$(O)

iso9660_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_iso9660.$(O)

reiserfs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_reiserfs.$(O)

minix_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_minix.$(O)

ufs2_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_ufs2.$(O)

vstafs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_vstafs.$(O)

ffs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_ffs.$(O)

xfs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_xfs.$(O)

ntfs_OBJS = $(PATH)start.$(O) $(PATH)fsys.$(O) $(PATH)dummy.$(O) $(PATH)fsys_ntfs.$(O)

fat_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_fat.$(SO)

ext2fs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_ext2fs.$(SO)

jfs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_jfs.$(SO)

iso9660_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_iso9660.$(SO)

reiserfs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_reiserfs.$(SO)

minix_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_minix.$(SO)

ufs2_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_ufs2.$(SO)

vstafs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_vstafs.$(SO)

ffs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_ffs.$(SO)

xfs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_xfs.$(SO)

ntfs_sh_OBJS = $(PATH)start.$(SO) $(PATH)fsys.$(SO) $(PATH)dummy.$(SO) $(PATH)fsys_ntfs.$(SO)

$(PATH)fat.$(OUT): $(fat_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)ext2fs.$(OUT): $(ext2fs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)jfs.$(OUT): $(jfs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)iso9660.$(OUT): $(iso9660_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)reiserfs.$(OUT): $(reiserfs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)minix.$(OUT): $(minix_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)ufs2.$(OUT): $(ufs2_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)vstafs.$(OUT): $(vstafs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)ffs.$(OUT): $(ffs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)xfs.$(OUT): $(xfs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)ntfs.$(OUT): $(ntfs_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="" E=$(OUT) OBJS="$<" FS=1 link

$(PATH)fat.$(SOUT): $(fat_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)ext2fs.$(SOUT): $(ext2fs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)jfs.$(SOUT): $(jfs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)iso9660.$(SOUT): $(iso9660_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)reiserfs.$(SOUT): $(reiserfs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)minix.$(SOUT): $(minix_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)ufs2.$(SOUT): $(ufs2_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)vstafs.$(SOUT): $(vstafs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)ffs.$(SOUT): $(ffs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)xfs.$(SOUT): $(xfs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)ntfs.$(SOUT): $(ntfs_sh_OBJS)
@$(MAKE) $(MAKEOPT) T=$^& S="s" E=$(SOUT) OBJS="$<" FS=1 link

$(PATH)fsys_fat.$(O): $(MYDIR)fsys_fat.c
$(SAY) Compiling $(MYDIR)fsys_fat.c...
$(CC) -dfsys_fat -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ext2fs.$(O): $(MYDIR)fsys_ext2fs.c
$(SAY) Compiling $(MYDIR)fsys_ext2fs.c...
$(CC) -dfsys_ext2fs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_jfs.$(O): $(MYDIR)fsys_jfs.c
$(SAY) Compiling $(MYDIR)fsys_jfs.c...
$(CC) -dfsys_jfs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_iso9660.$(O): $(MYDIR)fsys_iso9660.c
$(SAY) Compiling $(MYDIR)fsys_iso9660.c...
$(CC) -dfsys_iso9660 -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_reiserfs.$(O): $(MYDIR)fsys_reiserfs.c
$(SAY) Compiling $(MYDIR)fsys_reiserfs.c...
$(CC) -dfsys_reiserfs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_minix.$(O): $(MYDIR)fsys_minix.c
$(SAY) Compiling $(MYDIR)fsys_minix.c...
$(CC) -dfsys_minix -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ufs2.$(O): $(MYDIR)fsys_ufs2.c
$(SAY) Compiling $(MYDIR)fsys_ufs2.c...
$(CC) -dfsys_ufs2 -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_vstafs.$(O): $(MYDIR)fsys_vstafs.c
$(SAY) Compiling $(MYDIR)fsys_vstafs.c...
$(CC) -dfsys_vstafs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ffs.$(O): $(MYDIR)fsys_ffs.c
$(SAY) Compiling $(MYDIR)fsys_ffs.c...
$(CC) -dfsys_ffs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_xfs.$(O): $(MYDIR)fsys_xfs.c
$(SAY) Compiling $(MYDIR)fsys_xfs.c...
$(CC) -dfsys_xfs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ntfs.$(O): $(MYDIR)fsys_ntfs.c
$(SAY) Compiling $(MYDIR)fsys_ntfs.c...
$(CC) -dfsys_ntfs -dSHIFT=0 $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_fat.$(SO): $(MYDIR)fsys_fat.c
$(SAY) Compiling $(MYDIR)fsys_fat.c...
$(CC) -dfsys_fat -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ext2fs.$(SO): $(MYDIR)fsys_ext2fs.c
$(SAY) Compiling $(MYDIR)fsys_ext2fs.c...
$(CC) -dfsys_ext2fs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_jfs.$(SO): $(MYDIR)fsys_jfs.c
$(SAY) Compiling $(MYDIR)fsys_jfs.c...
$(CC) -dfsys_jfs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_iso9660.$(SO): $(MYDIR)fsys_iso9660.c
$(SAY) Compiling $(MYDIR)fsys_iso9660.c...
$(CC) -dfsys_iso9660 -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_reiserfs.$(SO): $(MYDIR)fsys_reiserfs.c
$(SAY) Compiling $(MYDIR)fsys_reiserfs.c...
$(CC) -dfsys_reiserfs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_minix.$(SO): $(MYDIR)fsys_minix.c
$(SAY) Compiling $(MYDIR)fsys_minix.c...
$(CC) -dfsys_minix -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ufs2.$(SO): $(MYDIR)fsys_ufs2.c
$(SAY) Compiling $(MYDIR)fsys_ufs2.c...
$(CC) -dfsys_ufs2 -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_vstafs.$(SO): $(MYDIR)fsys_vstafs.c
$(SAY) Compiling $(MYDIR)fsys_vstafs.c...
$(CC) -dfsys_vstafs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ffs.$(SO): $(MYDIR)fsys_ffs.c
$(SAY) Compiling $(MYDIR)fsys_ffs.c...
$(CC) -dfsys_ffs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_xfs.$(SO): $(MYDIR)fsys_xfs.c
$(SAY) Compiling $(MYDIR)fsys_xfs.c...
$(CC) -dfsys_xfs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fsys_ntfs.$(SO): $(MYDIR)fsys_ntfs.c
$(SAY) Compiling $(MYDIR)fsys_ntfs.c...
$(CC) -dfsys_ntfs -dSHIFT=$(SHIFT) $(COPT) -fr=$^*.err -fo=$^@ $<

$(PATH)fat.rel: $(PATH)fat.mdl $(PATH)fat.mds

$(PATH)ext2fs.rel: $(PATH)ext2fs.mdl $(PATH)ext2fs.mds

$(PATH)jfs.rel: $(PATH)jfs.mdl $(PATH)jfs.mds

$(PATH)iso9660.rel: $(PATH)iso9660.mdl $(PATH)iso9660.mds

$(PATH)reiserfs.rel: $(PATH)reiserfs.mdl $(PATH)reiserfs.mds

$(PATH)minix.rel: $(PATH)minix.mdl $(PATH)minix.mds

$(PATH)ufs2.rel: $(PATH)ufs2.mdl $(PATH)ufs2.mds

$(PATH)vstafs.rel: $(PATH)vstafs.mdl $(PATH)vstafs.mds

$(PATH)ffs.rel: $(PATH)ffs.mdl $(PATH)ffs.mds

$(PATH)xfs.rel: $(PATH)xfs.mdl $(PATH)xfs.mds

$(PATH)ntfs.rel: $(PATH)ntfs.mdl $(PATH)ntfs.mds

$(PATH)fat.mdl: $(PATH)fat.$(OUT)

$(PATH)ext2fs.mdl: $(PATH)ext2fs.$(OUT)

$(PATH)jfs.mdl: $(PATH)jfs.$(OUT)

$(PATH)iso9660.mdl: $(PATH)iso9660.$(OUT)

$(PATH)reiserfs.mdl: $(PATH)reiserfs.$(OUT)

$(PATH)minix.mdl: $(PATH)minix.$(OUT)

$(PATH)ufs2.mdl: $(PATH)ufs2.$(OUT)

$(PATH)vstafs.mdl: $(PATH)vstafs.$(OUT)

$(PATH)ffs.mdl: $(PATH)ffs.$(OUT)

$(PATH)xfs.mdl: $(PATH)xfs.$(OUT)

$(PATH)ntfs.mdl: $(PATH)ntfs.$(OUT)

$(PATH)fat.mds: $(PATH)fat.$(SOUT)

$(PATH)ext2fs.mds: $(PATH)ext2fs.$(SOUT)

$(PATH)jfs.mds: $(PATH)jfs.$(SOUT)

$(PATH)iso9660.mds: $(PATH)iso9660.$(SOUT)

$(PATH)reiserfs.mds: $(PATH)reiserfs.$(SOUT)

$(PATH)minix.mds: $(PATH)minix.$(SOUT)

$(PATH)ufs2.mds: $(PATH)ufs2.$(SOUT)

$(PATH)vstafs.mds: $(PATH)vstafs.$(SOUT)

$(PATH)ffs.mds: $(PATH)ffs.$(SOUT)

$(PATH)xfs.mds: $(PATH)xfs.$(SOUT)

$(PATH)ntfs.mds: $(PATH)ntfs.$(SOUT)
I didn't know of any arguments passing problems in Regina. Prokushev, if I correctly understood,
has no problems with Regina on Windows host. Under OS/2, arguments are passed as is -- if arguments
are "qwe rty uiop asd" and in the beginning of the script there is "parse arg arg1 arg2 rest", then
arg1=qwe, arg2=rty, rest="uiop asd".

PS: BTW, in all versions of wmake compiled for Linux, I got an error "macros nested too deep". How
did you overcome this problem?

WBR,
valery
do not use windows, try doors first
admin
Site Admin
Posts: 1925
Joined: Wed Dec 19, 2018 9:23 am
firstname: osFree
lastname: admin

Re: Build problems with autogen. makefiles under Linux

Post by admin »

Viking, Posted: Dec 12, 2008 2:45:34 am:

Hi!

To prokushev: The makefiles under the directory: osfree/bootseq/ has auto generated makefiles in
their build directories. Other makefiles like, say tools/SED only have quite simple autogen makefiles
with some comments and a simple include to the makefile in their source directory.

To Valerius: About the '$' character. The first attempt to get around the shell parsing problem was to
put quotes around them. That did work so the did leave them alone. Next problem is, at least I think
it is, wmake converts all groups of '$$' to a bunch of numbers, inside the quotes. So I end up with
nonworking makefiles again. Which can be seen below. Next step after that was/is to write some
makefile generation stuff with rexx code. I have tried to copy the main makefile output code from
osfree/mk/genrules.mk from the dependency rule: $(mf): $(MYDIR)makefile.

The rexx code is not working so well yet because some makefile variables is not set, like 'basename'
and such.

Here's what my autogen. makefile looks like (only parts of it):
#
# This is auto-generated file,
# don't edit!
#

!include /pub/projekt_src/osfree_23aug2007_svn/osfree/bootseq/loader/filesys/makefile

fat_OBJS = 2607526075(PATH)start.2607526075(O) 2607526075(PATH)fsys.2607526075(O) 2607526075(PATH)dummy.2607526075(O) 2607526075(PATH)fsys_fat.2607526075(O)

ext2fs_OBJS = 2607626076(PATH)start.2607626076(O) 2607626076(PATH)fsys.2607626076(O) 2607626076(PATH)dummy.2607626076(O) 2607626076(PATH)fsys_ext2fs.2607626076(O)

jfs_OBJS = 2607726077(PATH)start.2607726077(O) 2607726077(PATH)fsys.2607726077(O) 2607726077(PATH)dummy.2607726077(O) 2607726077(PATH)fsys_jfs.2607726077(O)

... Skipped content ...
fat_sh_OBJS = 2608626086(PATH)start.2608626086(SO) 2608626086(PATH)fsys.2608626086(SO) 2608626086(PATH)dummy.2608626086(SO) 2608626086(PATH)fsys_fat.2608626086(SO)

ext2fs_sh_OBJS = 2608726087(PATH)start.2608726087(SO) 2608726087(PATH)fsys.2608726087(SO) 2608726087(PATH)dummy.2608726087(SO) 2608726087(PATH)fsys_ext2fs.2608726087(SO)

jfs_sh_OBJS = 2608826088(PATH)start.2608826088(SO) 2608826088(PATH)fsys.2608826088(SO) 2608826088(PATH)dummy.2608826088(SO) 2608826088(PATH)fsys_jfs.2608826088(SO)

... Skipped content ...
$(PATH)fat.26097(OUT): $(fat_OBJS)
@$(MAKE) "$(MAKEOPT)" T="$^&" S="" E=26097(OUT) OBJS="$<" FS=1 link

$(PATH)ext2fs.26098(OUT): $(ext2fs_OBJS)
@$(MAKE) "$(MAKEOPT)" T="$^&" S="" E=26098(OUT) OBJS="$<" FS=1 link

$(PATH)jfs.26099(OUT): $(jfs_OBJS)
@$(MAKE) "$(MAKEOPT)" T="$^&" S="" E=26099(OUT) OBJS="$<" FS=1 link

... Skipped content ...
$(PATH)fat.26108(SOUT): $(fat_sh_OBJS)
@$(MAKE) "$(MAKEOPT)" T="$^&" S="s" E=26108(SOUT) OBJS="$<" FS=1 link

$(PATH)ext2fs.26109(SOUT): $(ext2fs_sh_OBJS)
@$(MAKE) "$(MAKEOPT)" T="$^&" S="s" E=26109(SOUT) OBJS="$<" FS=1 link

$(PATH)jfs.26110(SOUT): $(jfs_sh_OBJS)
@$(MAKE) "$(MAKEOPT)" T="$^&" S="s" E=26110(SOUT) OBJS="$<" FS=1 link

... Skipped content ...
"$(PATH)fsys_fat fsys_fat.2612026120(O)": "$(MYDIR)fsys_fat.c"
"$(SAY)" "Compiling $(MYDIR)fsys_fat.c..."
"$(CC)" -dfsys_fat -dSHIFT=0 "$(COPT)" -fr="$^*.err" -fo="$^@" "$<"

"$(PATH)fsys_ext2fs fsys_ext2fs.2612226122(O)": "$(MYDIR)fsys_ext2fs.c"
"$(SAY)" "Compiling $(MYDIR)fsys_ext2fs.c..."
"$(CC)" -dfsys_ext2fs -dSHIFT=0 "$(COPT)" -fr="$^*.err" -fo="$^@" "$<"

"$(PATH)fsys_jfs fsys_jfs.2612426124(O)": "$(MYDIR)fsys_jfs.c"
"$(SAY)" "Compiling $(MYDIR)fsys_jfs.c..."
"$(CC)" -dfsys_jfs -dSHIFT=0 "$(COPT)" -fr="$^*.err" -fo="$^@" "$<"

... Skipped content ...
"$(PATH)fsys_fat fsys_fat.2614226142(SO)": "$(MYDIR)fsys_fat.c"
"$(SAY)" "Compiling $(MYDIR)fsys_fat.c..."
"$(CC)" -dfsys_fat -dSHIFT=$(SHIFT) "$(COPT)" -fr="$^*.err" -fo="$^@" "$<"

"$(PATH)fsys_ext2fs fsys_ext2fs.2614426144(SO)": "$(MYDIR)fsys_ext2fs.c"
"$(SAY)" "Compiling $(MYDIR)fsys_ext2fs.c..."
"$(CC)" -dfsys_ext2fs -dSHIFT=$(SHIFT) "$(COPT)" -fr="$^*.err" -fo="$^@" "$<"

"$(PATH)fsys_jfs fsys_jfs.2614626146(SO)": "$(MYDIR)fsys_jfs.c"
"$(SAY)" "Compiling $(MYDIR)fsys_jfs.c..."
"$(CC)" -dfsys_jfs -dSHIFT=$(SHIFT) "$(COPT)" -fr="$^*.err" -fo="$^@" "$<"

... Skipped content ...
/pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/fat.rel: /pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/fat.mdl /pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/fat.mds

/pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/ext2fs.rel: /pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/ext2fs.mdl /pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/ext2fs.mds

/pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/jfs.rel: /pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/jfs.mdl /pub/projekt_src/osfree_23aug2007_svn/osfree/build/bootseq/loader/filesys/jfs.mds

... Skipped content ...
##############################################################################
Yes, adding backslashes might work. I'm going to try that. But that would work for wmake under
linux where the shell "eats" up the backslashes but what is then happen to that makefile code when
under OS/2 or Windows? Does'nt that break the makefiles?

I havent seen that error, "macros nested too deep", maybe because of the troubles I have? So I havent
gone that far.

The argument stuff I wondered about is that there is a lot of arguments I send to the rexx script, with
some are just continues "words" with no space in them and other are space-separated list inside quotes.
So I was wondered if that is possible to use under OS/2? Or if that would break the build under OS/2 and
Windows?

An example, without the "-a" switch
# regina hi.rex hello world "hello again"
Inside "hi.rex"

Code: Select all

parse arg a1, a2, a3, a4
say a1
say a2
say a3
say a4
[/quote]

prints out:

[code]
# regina hi.rex  hello  world  "hello again"

hello world hello again
But with the "-a" switch it becomes like this:

Code: Select all

# regina -a hi.rex  hello  world  "hello again"

hello
world
hello again
Thanks for help, Viking
admin
Site Admin
Posts: 1925
Joined: Wed Dec 19, 2018 9:23 am
firstname: osFree
lastname: admin

Re: Build problems with autogen. makefiles under Linux

Post by admin »

valerius, Posted: Dec 13, 2008 4:42:51 am:

It was a surprise to me that wmake converts dollar signs to sequences of numbers.
I can sugest an idea to construct command lines with dollars as variables and then a
result give to a shell for processing -- the shell will not receive a dollar sign at all:

Instead of

Code: Select all

$(PATH)jfs.26110(SOUT): $(jfs_sh_OBJS)
  @$(MAKE) "$(MAKEOPT)" T="$^&" S="s" E=26110(SOUT) OBJS="$<" FS=1 link
make a variable:

Code: Select all

command = "@$(MAKE) "$(MAKEOPT)" T="$^&" S="s" E=26110(SOUT) OBJS="$<" FS=1 link"
then wmake will "eat" dollars, and after this it is possible to give a resulting command
to a shell. A rule will be like this:

Code: Select all

$(PATH)jfs.$$(SOUT): $(jfs_sh_OBJS)
  $(command)
-- something like this.

and, as I understand, wmake internal commands like %create, %append etc. and all that
goes after these words, must not be passed to a shell.

And the second idea -- if UNIX variant of commands/rules can confuse OS/2 or Windows
make or command interpreter, you may make two variants by using a preprocessor (using
UNIX or ENV preprocessor variables):

Code: Select all

!ifeq UNIX  TRUE
...
!else
...
!endif
or

Code: Select all

!ifeq ENV Linux
...
!else ifeq ENV OS/2
...
!else ifeq ENV WIN32
...
!else
...
!endif
-- something like this. I think, wmake preprocessor works before wmake gives commands to a shell,
so problems with shell must not occur.

According the make variables -- they can be passed to scripts, I think. If, for example, substitute
needed variables to the same name, beginning with percent sign (i.e., %ENV instead of ENV), this changes variable ENV in the environment.

So, you assign

Code: Select all

%ENV=ENV
in the makefile and this way we can pass variables to scripts through environment. Then in REXX their
values can be obtained like this:

Code: Select all

env = value('ENV',,'ENVIRONMENT')
so, value of environment variable is assigned to a REXX variable.

According "-a" parameter -- this parameter does the following: -- if a script is called this way:

Code: Select all

# regina hi.rex hello world "hello again"
and script is like you specified:

Code: Select all

parse arg a1, a2, a3, a4
then a1 receives all command line. It you specify "-a", then each variable receives a word. In OS/2 REXX,
there is no parameter like "-a". A common practice is simply use the following parse statement (without
commas):

Code: Select all

parse arg a1 a2 a3 a4
then a1= hello, a2= world, a3= "hello, a4=again".

Note that REXX does not recognise if some words are enclosed by quotes. If you want to assign "hello again"
to a3 and a4="", you must do some parsing manually, like this:

Code: Select all

/**/

parse arg args

a1=getarg()
a2=getarg()
a3=getarg()
a4=getarg()

exit 0
/*-----------------*/
getarg: procedure expose args

/* Gets one word, or a line, enclosed
  in quotes, from args              */

args = strip(args)

if pos('"', args) == 1 then
  parse value args with '"' opt '"' args
else
  parse var args opt args


return opt
/*-----------------*/
That's it ;-)

WBR,
valery
do not use windows, try doors first
Post Reply