#!gmake # # The contents of this file are subject to the Netscape Public License # Version 1.0 (the "NPL"); you may not use this file except in # compliance with the NPL. You may obtain a copy of the NPL at # http://www.mozilla.org/NPL/ # # Software distributed under the NPL is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL # for the specific language governing rights and limitations under the # NPL. # # The Initial Developer of this code under the NPL is Netscape # Communications Corporation. Portions created by Netscape are # Copyright (C) 1998 Netscape Communications Corporation. All Rights # Reserved. DEPTH = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = mimetype LIBRARY_NAME = mimetype DEFINES += -D_IMPL_NS_NET CSRCS = \ mkformat.c \ $(NULL) EXPORTS=$(srcdir)/mkformat.h include $(topsrcdir)/config/config.mk REQUIRES = network img layer util include $(topsrcdir)/config/rules.mk # # This converts mime.types to C source code, # and also to an HTML table that shows what's in it. # MIME_TYPES = $(srcdir)/mime.types MIME_TYPES_UNIX = $(srcdir)/mime.types-unix MIME_TYPES_NONUNIX = $(srcdir)/mime.types-nonunix AD2C = sh $(topsrcdir)/cmd/xfe/ad2c mktypes.h: $(MIME_TYPES) $(MIME_TYPES_UNIX) $(MIME_TYPES_NONUNIX) rm -f $@ @echo "generating $@ from $<..." ; \ (echo '/* Generated file - do not edit! */' ; \ echo '' ; \ cat $(MIME_TYPES) | grep -v '^#' | $(AD2C) ; \ echo '' ; \ echo '#ifdef XP_UNIX' ; \ cat $(MIME_TYPES_UNIX) | grep -v '^#' | $(AD2C) ; \ echo '#else /* !XP_UNIX */' ; \ cat $(MIME_TYPES_NONUNIX) | grep -v '^#' | $(AD2C) ; \ echo '#endif /* !XP_UNIX */' ; \ ) > $@ mime-types.html: $(MIME_TYPES) $(MIME_TYPES_UNIX) rm -f $@ @echo "generating $@ from $<..." ; \ (echo 'Netscape MIME Types' ; \ echo '

Netscape MIME Types

' ; \ echo '
' ; \ echo '' ; \ echo '' ; \ echo '' ; \ echo '' ; \ cat $(MIME_TYPES) $(MIME_TYPES_UNIX) | grep -v '^#' | \ sed 's@exts="\([^"]*\)"[ ]*[\]*@@; \ s@desc="\([^"]*\)"[ ]*[\]*@@; \ s@enc=\([^ ]*\)[ ]*[\]*$$@@; \ s@type=\([^ ]*\)[ ]*[\]*$$@@; \ s@icon=\([^ ]*\)[ ]*[\]*$$@@'\ | sed 's/,/ /g' \ | awk '{if ( $$0 ~ /^\)\(\)\(\)\(\)\(\)\(\)$$@\1\5!\3!\2!\4\6@' \ | tr '!' '\012' \ | sed 's@@@' ; \ echo '
Content Type:Extensions:Description:
\1\1encoding/\1\1
.*.*.*.*
' ; \ echo '
' ; \ ) > $@