add support for building utf8 library
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 14 Aug 2002 00:52:00 +0000 (00:52 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 14 Aug 2002 00:52:00 +0000 (00:52 +0000)
src/share/Makefile.lite
src/share/Makefile.vc

index eb79fef..c06beda 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 LIB_NAME = libgetopt
-INCLUDES = -I../../include
+INCLUDES = -I../../include -I../../include/share
 
 OBJS = \
        getopt.o \
@@ -11,4 +11,30 @@ OBJS = \
 
 include ../../build/lib.mk
 
+# Our lame Makefile.lite system has no provision for building multiple libs in
+# a directory, so we hack it:
+UTF8_LIB_NAME = libutf8
+UTF8_OBJS = charset.o iconvert.o utf8.o
+UTF8_STATIC_LIB = $(LIBPATH)/$(UTF8_LIB_NAME).$(STATIC_LIB_SUFFIX)
+UTF8_DYNAMIC_LIB = $(LIBPATH)/$(UTF8_LIB_NAME).$(DYNAMIC_LIB_SUFFIX)
+
+debug: $(UTF8_STATIC_LIB) $(UTF8_DYNAMIC_LIB)
+
+release: $(UTF8_STATIC_LIB) $(UTF8_DYNAMIC_LIB)
+
+clean: utf8_clean
+
+utf8_clean:
+       rm -f $(UTF8_OBJS) $(UTF8_STATIC_LIB) $(UTF8_DYNAMIC_LIB)
+
+$(UTF8_STATIC_LIB): $(UTF8_OBJS)
+       $(LINK) $@ $(UTF8_OBJS) && ranlib $@
+
+$(UTF8_DYNAMIC_LIB): $(UTF8_OBJS)
+ifeq ($(DARWIN_BUILD),yes)
+       $(LINKD) -o $@ $(UTF8_OBJS) $(LFLAGS) $(LIBS) -lc
+else
+       $(LINKD) -o $@ $(UTF8_OBJS) $(LFLAGS) $(LIBS)
+endif
+
 # DO NOT DELETE THIS LINE -- make depend depends on it.
index 597c764..0dcd227 100644 (file)
@@ -14,11 +14,17 @@ C_FILES= \
 \r
 OBJS= $(C_FILES:.c=.obj)\r
 \r
-all: getopt.lib\r
+UTF8_OBJS=charset.o iconvert.o utf8.o\r
+\r
+all: getopt.lib utf8.lib\r
 \r
 getopt.lib: $(OBJS)\r
        link.exe -lib /nodefaultlib -out:../../obj/lib/$*.lib $(OBJS)\r
 \r
+utf8.lib: $(UTF8_OBJS)\r
+       link.exe -lib /nodefaultlib -out:../../obj/lib/$*.lib $(UTF8_OBJS)\r
+\r
 clean:\r
        -del *.obj *.pch\r
        -del ..\..\obj\lib\getopt.lib ..\..\obj\lib\getopt.pdb\r
+       -del ..\..\obj\lib\utf8.lib ..\..\obj\lib\utf8.pdb\r