From 547c9af31a29769b1f53fac8cb094f1f9071be0f Mon Sep 17 00:00:00 2001 From: Hiroki Mori Date: Sun, 12 Sep 2021 11:44:27 +0900 Subject: [PATCH] build on open watcom 2.0 --- Resource.rc | 2 +- Win16App.mif | 6 +++++ makefile | 13 +++++++++ master.mif | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 Win16App.mif create mode 100644 makefile create mode 100644 master.mif diff --git a/Resource.rc b/Resource.rc index 7b1731d..b22c13e 100644 --- a/Resource.rc +++ b/Resource.rc @@ -21,7 +21,7 @@ // Icon // -IDI_APPICON ICON DISCARDABLE "APP.ICO" +IDI_APPICON ICON DISCARDABLE "App.ico" ////////////////////////////////////////////////////////////////////////////// // diff --git a/Win16App.mif b/Win16App.mif new file mode 100644 index 0000000..4ecc82c --- /dev/null +++ b/Win16App.mif @@ -0,0 +1,6 @@ +name = Win16App +rname = Resource +LNK = $(name).lnk +OBJS = AboutDlg.obj MainWnd.obj WinMain.obj +resources = App.ico +lnk_dependencies = makefile Win16App.mif master.mif diff --git a/makefile b/makefile new file mode 100644 index 0000000..88b2f9d --- /dev/null +++ b/makefile @@ -0,0 +1,13 @@ +platform = Win16 +CC = wcc +CFLAGS = -zW +res1_flags = -bt=windows -30 + +!include Win16App.mif +!include master.mif + +linkit : .PROCEDURE + @%append $(LNK) system windows + +bindit : .PROCEDURE + wrc $(RCINCS) Resource.rc Win16App.exe diff --git a/master.mif b/master.mif new file mode 100644 index 0000000..dcce761 --- /dev/null +++ b/master.mif @@ -0,0 +1,75 @@ +# +# this make include file is used to build all the win examples +# +# It assumes that the following make variables are declared by the makefile +# that includes it: +# +# CC the name of the C compiler to use to create +# the .obj files +# CDIR directories other than .. to be searched for +# .c files +# CFLAGS any compiler flags needed to build the +# object files +# name the name of the EXE file to build (without +# any extension) +# LNK the name of the linker command file +# OBJS a list of the .obj files needed to build +# the EXE +# resources a list of all files the .res file is +# dependent upon +# res1_flags flags to be used by the resource compiler's +# first pass +# res2_flags flags to be used by the resource compiler's +# second pass +# lnk_dependencies a list of files the linker command file +# depends upon +# platform Win32 for Win9x/Me/NT/2K/XP, Win16 for 3.x/Win386 +# +# In addition the makefile must declare a procedure called linkit that +# that can be used to add commands to the linker command file + +!ifeq platform Win32 +CFLAGS += -I"$(%WATCOM)/h" -I"$(%WATCOM)/h/nt" +RCINCS += -I"$(%WATCOM)/h/nt" +!else +CFLAGS += -I"$(%WATCOM)/h" -I"$(%WATCOM)/h/win" +RCINCS += -I"$(%WATCOM)/h/win" +!endif + +CFLAGS += -zq -oaxt -d2 -w8 -fo=.obj + +$(name).exe : $(OBJS) $(rname).rc $(LNK) + wlink @$(LNK) + @%make bindit + +$(name).res : $(name).rc $(resources) + wrc -q -r -I.. $(RCINCS) -fo=./$(name).res $(res1_flags) $[@ + +$(LNK) : $(lnk_dependencies) + %create $(LNK) + @%append $(LNK) debug all + @%append $(LNK) name $(name) + @%append $(LNK) op map, quiet + @%make linkit + @for %i in ($(OBJS)) do @%append $(LNK) file %i + + +.EXTENSIONS: +.EXTENSIONS: .exe +.EXTENSIONS: .obj +.EXTENSIONS: .c .h .dlg .rc .ico .bmp .cur + +.c:..;$(CDIR) +.ico:.. +.bmp:.. +.cur:.. +.rc:.. +.dlg:.. + +.c.obj : + $(CC) $(CFLAGS) $[* + +clean: .symbolic + rm -f *.obj *.err *.exe *.lnk *.res *.rex *.lib *.sym *.map + rm -f *.lk1 *.mk1 *.mk +