#--------------------------------------------------------------------
#
# Makefile for HPcalc
#
# Using EMX
#--------------------------------------------------------------------
 
B=/emx/bin/
I=\emx\include
L=/emx/lib/
CC=gcc
CFLAGS=-O -Wall -Zsys -Zomf
LFLAGS=-Zsys -Zomf -s
OBJ=obj

A=HPcalc
VER=097
OBJS= $(A).$(OBJ) interface.$(OBJ) change.$(OBJ) ini.$(OBJ) \
      hex-oct.$(OBJ)
DIST= $(A).exe ReadMe file_id.diz
SRC= $(DIST) interface.c change.c change.h HPclc$(VER).txt\
	$(A).h buttons.h interface.h Makefile $(A).ico $(A).rc \
	ini.c ini.h hex-oct.c hex-oct.h $(A)D.dlg interface-vars.h \
	ReadMe.Int HPcalc.def HPcalc.c


all: $(A).exe $(A)D.res

$(A).res: $(A).rc $(A).h $(A).ico $(A)D.dlg
	rc -r -i $(I) $(A).rc

$(A)D.res: $(A).res
	copy $(A).res $(A)D.res

# $(A).exe:   $(A)

$(A).exe:  $(OBJS) $(A)D.res
	$(CC) $(LFLAGS)  $(OBJS) $(A).def $(A).res -Zlinker /BASE:0x10000
	rc -x1 $(A).res $(A).exe

$(A).$(OBJ): $(A).c $(A).h interface.h buttons.h change.h ini.h
	$(CC) $(CFLAGS) -c $(A).c
   
interface.$(OBJ): interface.c interface.h interface-vars.h $(A).h hex-oct.h
	$(CC) $(CFLAGS) -c interface.c

change.$(OBJ): change.c change.h $(A).h interface.h
	$(CC) $(CFLAGS) -c change.c

hex-oct.$(OBJ): hex-oct.c $(A).h interface.h interface-vars.h 
	$(CC) $(CFLAGS) -c hex-oct.c

ini.$(OBJ): ini.c ini.h interface.h interface-vars.h change.h
	$(CC) $(CFLAGS) -c ini.c

clean:
	del *.$(OBJ) core rc0* *.res

zip: HPclc$(VER).zip

HPclc$(VER).zip: $(DIST)
	zip -u -9 HPclc$(VER) $(DIST)

source: HPsrc$(VER).zip
src: HPsrc$(VER).zip

HPsrc$(VER).zip: $(SRC)
	zip -u -9 HPsrc$(VER) $(SRC)

