Author Topic: Compiling a PM sample with GCC  (Read 53403 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5033
  • Karma: +114/-1
    • View Profile
Re: Compiling a PM sample with GCC
« Reply #75 on: July 04, 2022, 06:23:41 am »
SET INCLUDE=%UNIXROOT%/usr/include;%INCLUDE% works here. Remember that rc etc are Dosish programs and don't understand things like @unixroot. Ideally the directory separators should be \ but / seems OK.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5033
  • Karma: +114/-1
    • View Profile
Re: Compiling a PM sample with GCC
« Reply #76 on: July 04, 2022, 06:32:43 am »
As an alternative, could add the include to the makefile in the walker.res rule,
Code: [Select]
rc -r -i %%UNIXROOT%%\usr\include walker.rc
Seems that the % needs doubled up, escape character?

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4992
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Compiling a PM sample with GCC
« Reply #77 on: July 04, 2022, 10:31:27 pm »
As an alternative, could add the include to the makefile in the walker.res rule,
Code: [Select]
rc -r -i %%UNIXROOT%%\usr\include walker.rc
Seems that the % needs doubled up, escape character?

There was no luck with me with this change. I get this error:

Code: [Select]
[E:\PROJECTS\SAMPLEPACK\PMWALKER]make   2>&1  | tee make.out
gcc -Wall -Zomf -c -O2 walker.c -o walker.obj
rc -r -i %%UNIXROOT%%\usr\include walker.rc
fatal error C1015: cannot open include file 'os2.h'
Operating System/2 Resource Compiler
Version 4.00.011 Oct 10 2000
(C) Copyright IBM Corporation 1988-2000
(C) Copyright Microsoft Corp. 1985-2000
All rights reserved.


Creating binary resource file walker.RES
RC:  RCPP -E -D RC_INVOKED -W4 -f walker.rc -ef C:\OS2\RCPP.ERR -I %%UNIXROOT%%\usr\include
make: *** [walker.res] Error 3

« Last Edit: July 05, 2022, 02:57:04 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5033
  • Karma: +114/-1
    • View Profile
Re: Compiling a PM sample with GCC
« Reply #78 on: July 05, 2022, 12:00:36 am »
I did the change for nmake. Make might work using cmd.exe as the shell. SET MAKESHELL=cmd.exe or use /@unixroot/usr/include with sh.exe as the shell.

Lars

  • Hero Member
  • *****
  • Posts: 1362
  • Karma: +70/-0
    • View Profile
Re: Compiling a PM sample with GCC
« Reply #79 on: July 05, 2022, 09:41:44 am »
At least nmake.exe treats all environment variables as makefile variables (unless you suppress this via a commandline switch).
Therefore, you can do this (from an nmake makefile):

rc -r -i $(UNIXROOT)\usr\include walker.rc

Maybe the same thing works for make.exe.