# Sample widget — DVX widget Makefile
#
# Adjust DJGPP_PREFIX, SDK_DIR, and DVXRES for your environment.

DJGPP_PREFIX = $(HOME)/djgpp/djgpp
CC           = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
DXE3GEN      = PATH=$(DJGPP_PREFIX)/bin:$(PATH) DJDIR=$(DJGPP_PREFIX)/i586-pc-msdosdjgpp $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/dxe3gen

SDK_DIR      = ../..
DVXRES       = dvxres
CFLAGS       = -O2 -Wall -Wextra -Werror -march=i486 -mtune=i586 \
               -I$(SDK_DIR)/include/core

.PHONY: all clean

all: mywgt.wgt

mywgt.wgt: mywgt.o mywgt.res icon24.bmp
	$(DXE3GEN) -o mywgt.dxe -U mywgt.o
	mv mywgt.dxe $@
	$(DVXRES) build $@ mywgt.res

mywgt.o: mywgt.c
	$(CC) $(CFLAGS) -c -o $@ $<

clean:
	rm -f mywgt.o mywgt.wgt
