#マクロ定義
USRD = f:

CPP  = $(USRD)\run386 -nocrt $(USRD)\usr\bin\cpp
CC   = $(USRD)\run386 -nocrt $(USRD)\usr\bin\cc1
ASM  = $(USRD)\run386 -nocrt $(USRD)\usr\bin\gas
LINK = $(USRD)\run386 $(USRD)\usr\bin\ld
EXP_ = $(USRD)\usr\bin\genexp

CPOP = -D__GNUC__ -DTOWNS -I $(USRD)/usr/include
CCOP = -O -quiet -msoft-float
ASOP = 
LIOP = -N -S
EXOP = 

LIB  = -L$(USRD)/usr/lib -lce -lt

TMP  =i:

#生成規則

.SUFFIXES: .o .c .s
.s.o:
	$(ASM) $(ASOP) -o $@ $<
.c.o:
	$(CPP) $(CPOP) $< $(TMP)_tmp.i
	$(CC) $(CCOP) $(TMP)_tmp.i
	$(ASM) $(ASOP) -o $@ $(TMP)_tmp.s

#生成手順

genji.exp : genji.o subobj.o command.o print.o value.o
	$(LINK) $(LIOP) -o $(TMP)_tmp.bin $(USRD)/usr/lib/crt0.o genji.o subobj.o command.o print.o value.o $(LIB)
	$(EXP_) $(TMP)_tmp.bin $@

command.o : command.c genji.h

genji.o : genji.c netdata.c printcom.c genji.h

subobj.o : subobj.c genji.h

clear :
	del *.bak

backup :
	lha u ..\backup\genji *.*
