# Sample library — DVX library Makefile
#
# Adjust DJGPP_PREFIX 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

CFLAGS       = -O2 -Wall -Wextra -Werror -march=i486 -mtune=i586

.PHONY: all clean

all: mylib.lib

mylib.lib: mylib.o
	$(DXE3GEN) -o mylib.dxe -U $<
	mv mylib.dxe $@

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

clean:
	rm -f mylib.o mylib.lib
