# Hello World app — sample DVX application 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 \
               -I$(SDK_DIR)/include/shell \
               -I$(SDK_DIR)/include/widget

.PHONY: all clean

all: hello.app

hello.app: hello.o hello.res icon32.bmp
	$(DXE3GEN) -o $@ -U hello.o
	$(DVXRES) build $@ hello.res

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

clean:
	rm -f hello.o hello.app
