# Makefile for DJGPP libgrx V2 builds of JLib.
# note that I dont -fomit-frame-pointer as this causes crashes under windows.
# This only works for DJGPP V2,  V1 will not run correctly.
#

AR       = ar
CC       = gcc
OPTIMIZE = -O3

CFLAGS   = $(OPTIMIZE)
LIBS = -lj -lpc -lgrx20

TARGET  = target/djgrx2/palette.o target/djgrx2/blit.o    \
	  target/djgrx2/blast.o   target/djgrx2/memcopy.o \
	  target/djgrx2/misc.o    target/djgrx2/mouse.o   \
	  target/djgrx2/kb_v2.o   target/djgrx2/lock.o


include target/common

all:    libj.a $(DEMOS) $(UTES)

libj.a: $(TARGET) $(MODULES)
	del libj.a
	$(AR) rcs libj.a $(MODULES)
	$(AR) rcs libj.a $(TARGET)
#==============================================================================
#
# IMPORTANT: CHANGE the line below to copy libj.a to your \gcc\lib directory!
#
#============================================================================== 
	copy libj.a \gcc\lib

clean:
	rm $(MODULES) $(TARGET)

realclean:
	rm $(DEMOS) $(UTES)

%.exe : %.foo
	rm $<

%.foo : %.c
	$(CC) $(CFLAGS) -o $@ $< $(LIBS)

