# Makefile for EMX on OS/2 with OMF-Style linkage
# No support for the Husky build environment

CC=	gcc
CFLAGS=	-Wall -Zomf -Zsys
CDEFS=	-DOS2 -DNOSEMAPHORES
COPT=	-O3 -fomit-frame-pointer -fstrength-reduce -Wall -funsigned-char -s
LIB=	emxomfar

.SUFFIXES:
.SUFFIXES: .c .obj

TARGET=	smapiemo.lib

OBJS=	1stchar.obj  \
	api_sdm.obj  \
	sq_area.obj \
	sq_hash.obj \
	sq_help.obj \
	sq_idx.obj \
	sq_kill.obj \
	sq_lock.obj \
	sq_misc.obj \
	sq_msg.obj \
	sq_read.obj \
	sq_uid.obj \
	sq_write.obj \
	api_jam.obj  \
	cvtdate.obj  \
	date2bin.obj \
	dosdate.obj  \
	fexist.obj   \
	ffind.obj    \
	flush.obj    \
	locking.obj  \
	months.obj   \
	msgapi.obj   \
	parsenn.obj  \
	patmat.obj   \
	qksort.obj   \
	strftim.obj  \
	strocpy.obj  \
	structrw.obj \
	trail.obj    \
	weekday.obj \
	semaphor.obj \
	setfsize.obj \
	tdelay.obj


# Thunderbirds are go!

.c.obj:
	$(CC) $(CFLAGS) $(CDEFS) $(COPT) -c $<

$(TARGET): $(OBJS)
	$(LIB) r $@ $?

clean:
	-cmd /c DEL *.obj

distclean: clean
	-cmd /c DEL $(TARGET)

smapi.dll: $(OBJS)
	echo LIBRARY smapi > smapi.def
	echo EXPORTS >> smapi.def
	emxexp $(OBJS) >> smapi.def
	$(CC) -Zdll -Zcrtdll -Zomf -Zlinker /PM:VIO -o smapi.dll smapi.def $(OBJS)
	emximp -o $(TARGET) smapi.def
#	emximp -o smapiemx.a smapi.def


syntax highlighted by Code2HTML, v. 0.9.1