Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Open Watcom C/C++'s wmake Makefiles #26

Open
ssokolow opened this issue Nov 2, 2019 · 1 comment
Open

Support Open Watcom C/C++'s wmake Makefiles #26

ssokolow opened this issue Nov 2, 2019 · 1 comment

Comments

@ssokolow
Copy link

ssokolow commented Nov 2, 2019

Output of checkmake --version

checkmake  built at  by  with

(Built from commit 03dd76b on 2019-11-02 using a freshly installed go version go1.13.4 linux/amd64 from the official site on Kubuntu Linux 16.04 LTS.)

Output of checkmake --debug <your makefile>

2019/11/02 06:17:37 Unable to match line '' to a Rule or Variable
2019/11/02 06:17:37 Unable to match line '' to a Rule or Variable
2019/11/02 06:17:37 Unable to match line 'test' to a Rule or Variable
2019/11/02 06:17:37 Unable to match line '      @echo ...and this is the shorthand form which I don't use because' to a Rule or Variable
2019/11/02 06:17:37 Unable to match line '      @echo it confuses Vim's syntax highlighting' to a Rule or Variable
2019/11/02 06:17:37 Unable to parse config file "checkmake.ini", running with defaults
2019/11/02 06:17:37 Running rule 'maxbodylength'...
2019/11/02 06:17:37 iniFile not initialized
2019/11/02 06:17:37 Running rule 'minphony'...
2019/11/02 06:17:37 iniFile not initialized
2019/11/02 06:17:37 Running rule 'phonydeclared'...
2019/11/02 06:17:37 iniFile not initialized
2019/11/02 06:17:37 Running rule 'timestampexpanded'...
2019/11/02 06:17:37 iniFile not initialized
2019/11/02 06:17:37 iniFile not initialized
                                                           
    RULE              DESCRIPTION             LINE NUMBER  
                                                           
  minphony   Missing required phony target    0            
             "all"                                         
  minphony   Missing required phony target    0            
             "clean"                                       
  minphony   Missing required phony target    0            
             "test"  

Output of make --version

As a cross-platform port of a tool originally for DOS and Windows, wmake doesn't implement --version, but I've confirmed the problem with the Linux versions of wmake included in OpenWatcom C/C++ 1.9 and one of the recent 2.0 builds.

(Note that the 1.9 installer for Linux and the 2.0 installer for Linux from 2015 have a known bug that'll cause them to crash if they can't find the terminal info database at an obsolete location. You need to either export TERMINFO=/lib/terminfo or export TERM=vt100 before running them... or just unzip them and write an owsetenv.sh by hand.)

Sample Makefile to reproduce issue

all: .SYMBOLIC
	@echo This is one way to write a .PHONY target in WMAKE

test
	@echo ...and this is the shorthand form which I don't use because
	@echo it confuses Vim's syntax highlighting

From this, the three differences should be pretty obvious:

  1. Instead of listing phony targets as dependencies of .PHONY, you list .SYMBOLIC as a dependency of each phony target in wmake.
  2. There's a shorthand form which has no colon or dependencies that I wouldn't expect anyone to support. I certainly don't use it.
  3. There's an echo builtin which follows the command-parsing semantics of the MS-DOS echo builtin. (ie. everything between echo and the end of the line is treated as a literal string. Hence the ' in don't is not an unbalanced quote.)

The dialect as a whole is described in chapter 10 of the "Open Watcom C/C++ Tools User’s Guide" (with .SYMBOLIC being described in section 10.32). That's available as ctools.pdf or ctools.html for 2.0 or tools.pdf for 1.9.

Now, to show how checkmake almost fits the bill in a real-world scenario, here's the non-debug output (because the debug output is long) from the much larger, more complex Makefile for my DOS hobby project (which supports both Linux and DOS as build environments):

      RULE                 DESCRIPTION             LINE NUMBER  
                                                                
  phonydeclared   Target "all" should be                   115  
                  declared PHONY.                               
  maxbodylength   Target body for "testrun"                153  
                  exceeds allowed length of 5                   
                  (9).                                          
  minphony        Missing required phony target    0            
                  "all"                                         
  minphony        Missing required phony target    0            
                  "clean"                                       
  minphony        Missing required phony target    0            
                  "test"                                        

I'll post more about that makefile on request.

@ssokolow
Copy link
Author

ssokolow commented Nov 2, 2019

Oh, actually, there is one other thing it would need to learn.

  maxbodylength   Target body for "testrun"                153  
              exceeds allowed length of 5                   
              (9).     

That's getting confused by the !ifdef/!ifndef/!ifeq/!else/!endif/etc. lines which must not have any whitespace before the ! but can have as much as you want between it and the ifdef.

testrun is actually 72 lines long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant