# nsime.exe y nsimedll.dll ̗rh邽߂̃CNt@C
# iIBM-C Set++pj
#
# OƂĂJ
#
# @AZuFMASM 6.00
# @@@@@is̕ij
# @bRpCFIBM-C Set++ 2.01
# @@@@@ij
# @JFLINK386
# @@@@@ic[Lbg܂͂nrɕtj
# @\[XRpCFRC
# @@@@@ij
# @CNFNMAKE
# @@@@@ic[LbgɕtA邢 Hobbes œ\j
# @̑F{ WARP4 ɕt J-Pocket Ɋ܂܂Ăhlpc[Lbg
# @@@@@ios2im.h y os2im.lib AꂼCN[h/Cu
# @@@@@fBNgɃRs[j
# @@@@@REXX
# @@@@@inrɕtj
# @@@@@SED
# @@@@@iHobbes œ\j
!include "version.mak"

# c[`
#
AS		=	ml.exe
CC		=	icc.exe
LINK	=	link386.exe
# !undef AS
# ̍s̃Rg菜ƁAAZuKvȃ\[X(_start2.asm)
# @rhs܂B
# @AZuĂȂA邢͂bCuĝ߂ɐ݂
# @܂B
# @ȂȀꍇ͂bCũftHg̃X^[gAbvR[hp̂ŁA
# @st@CTCY傫Ȃ܂B

CFLAGS	=	/C /O- /Q /Sn /Ss \
			/Wall /Wppt- /Wgnr- /Wcpy- /Wcls- /Wtrd- /Wvft- /Wcmp- /Wuni- /Wobs- /Wpor- /Wext- /Wpar-
LFLAGS	=	/NOLOGO /ALIGN:2 /NOE /NOI /BATCH
!ifdef AS
AFLAGS	=	/c /nologo
CFLAGS	=	$(CFLAGS) /Dmain=MAIN
LFLAGS	=	$(LFLAGS) /NOD
!endif


# IuWFNgt@C`
#
EXEOBJS	=	nsime.obj
DLLOBJS	=	nsimedll.obj
!ifdef AS
EXEOBJS	=	_start2.obj $(EXEOBJS)
!endif


# rh菇`
#
nsime.exe: $(EXEOBJS) nsimedll.dll nsime.def nsimetmp.res
	$(LINK) $(LFLAGS) $(EXEOBJS) ,$@ ,nul.map ,os2386.lib ,nsime.def
	rc -p -x2 nsimetmp.res $@

nsimedll.dll: $(DLLOBJS) nsimedll.def
	$(LINK) $(LFLAGS) $(DLLOBJS) ,$@ ,nul.map ,os2386.lib os2im.lib ,nsimedll.def

.SUFFIXES:
.SUFFIXES: .asm .c

.asm.obj:
	$(AS) $(AFLAGS) $?

.c.obj:
	$(CC) $(CFLAGS) $?

nsime.c: nsimedll.h nsimeres.h nsimedlg.h nsimever.h

nsimedll.c: nsimedll.h nsimever.h

nsimetmp.res: nsimetmp.rc nsimeres.h nsimedlg.h nsimeico.ico
	rc -r nsimetmp.rc $@

nsimetmp.rc: nsimeres.rc nsimedlg.dlg
	sed -e "s/DLGINCLUDE [0-9]*/#include/" nsimeres.rc nsimedlg.dlg > $@
#
# @nsimedlg.h y nsimedlg.dlgiy nsimedlg.resj́AOS/2 c[
# Lbǵu_CAOEGfB^[(DLGEDIT.EXE)vō쐬t@C
# łB
# @nsimedlg.res ́ACNɂ͕Kv̂łAu_CAOEGf
# B^[vŕҏW鎖OɂēĂ܂B
#

!if "$(REVISION)"==""
REVISIONCHR	=	'\0'
!else
REVISIONCHR	=	'$(REVISION)'
!endif

nsimever.h: version.mak
	if exist $@ del $@
	rexxtry s=left('$(VERSION)',1)'.'substr('$(VERSION)',2); \
		if right(s,1)='0' then s=delstr(s,length(s)); \
		call lineout '$@' ,'#define NSIME_VERSION_VAL 0x$(VERSION)'; \
		call lineout '$@' ,'#define NSIME_VERSION_STR "'s'"'; \
		call lineout '$@' ,"#define NSIME_REVISION_CHR $(REVISIONCHR)"; \
		call lineout '$@' ,'#define NSIME_REVISION_STR "$(REVISION)"'; \
		>nul
#
# @o[Wԍ̊Ǘ́ACNt@C̃CN[ht@C
# version.mak ōsĂA̋Lq́A nsimever.h ɔf
# 菇łB
# @̂킴킴CNt@Căo[WԍǗs
# ̂́A҂̌lIsƌŌe͂B(^^U
#
# @ȂAemx/gcc(GNU-MAKE) ŃCNꍇ́Aversion.mak 
# QƂɃCNs܂B
# iڍׂ makefile.emx QƂ̂Ɓj
#

