# Makefile for OS/2 and emx+gcc

release:
	$(MAKE) -f Makefile.os2 gnuintl.dll intl.lib \
	CC="gcc -Zomf -O" O=".obj" A=".lib" \
	LFLAGS="-s -Zcrtdll" DLFLAGS="-s -Zcrtdll -Zdll" \
	AR="emxomfar" RANLIB="emxomfar s"
debug:
	$(MAKE) -f Makefile.os2 intl.a \
	CC="gcc -g" O=".o" A=".a" \
	AR="ar" RANLIB="ar s"

CFLAGS = -I.. -DHAVE_CONFIG_H

OBJECTS = bindtextdom$O dcgettext$O dgettext$O gettext$O \
	finddomain$O loadmsgcat$O localealias$O textdomain$O \
	l10nflist$O explodename$O intl-compat$O

.SUFFIXES: .c $O

.c$O:
	$(CC) $(CFLAGS) -c $<

.PHONY: lib dll
lib: intl.a
dll: gnuintl.dll intl.lib

$(OBJECTS): ../config.h libintl.h

libintl.h: libgettext.h
	copy libgettext.h $@

intl.a: $(OBJECTS)
	-del $@
	$(AR) cru $@ $(OBJECTS)
	$(AR) s $@

intl.lib: gnuintl.def
	emximp -o $@ gnuintl.def

gnuintl.dll: gnuintl.def $(OBJECTS)
	$(CC) gnuintl.def -o $@ $(OBJECTS) $(DLFLAGS)

clean:
	rm -f *.o *.obj *.a *.lib libintl.h
