# -*- Mode: Makefile -*- # # The contents of this file are subject to the Netscape Public # License Version 1.1 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at http://www.mozilla.org/NPL/ # # Software distributed under the License is distributed on an "AS # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or # implied. See the License for the specific language governing # rights and limitations under the License. # # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is Netscape # Communications Corporation. Portions created by Netscape are # Copyright (C) 1998 Netscape Communications Corporation. All # Rights Reserved. # # Contributor(s): # DEPTH = ../../.. topsrcdir = @top_srcdir@ VPATH = @srcdir@ srcdir = @srcdir@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/config.mk REAL_XPDIR = $(topsrcdir)/lib/xp HSRCS = $(wildcard $(srcdir)/*.html) MSRCS = $(wildcard $(srcdir)/*.msg) HOBJS = $(subst $(srcdir)/,,$(HSRCS)) HOBJS := $(HOBJS:.html=.h) MOBJS = $(subst $(srcdir)/,,$(MSRCS)) MOBJS := $(MOBJS:.msg=.h) RM = /bin/rm -f # # tr has a bug on linux. # tr '[\001-\272]' '[\106-\377]' # does not translate char ']' So we use our own program to do this # TR69 = $(OBJDIR)/tr69 TARGETS = $(TR69) TARGETS += $(addprefix $(OBJDIR)/, $(HOBJS) $(MOBJS) splash.h \ splash-java.h about-lite.h about-java-lite.h splash-lite.h \ splash-java-lite.h ) GARBAGE += $(OBJDIR)/about-lite.html $(OBJDIR)/about-java-lite.html GARBAGE += $(wildcard $(OBJDIR)/splash*.html) $(wildcard $(OBJDIR)/*.pc) $(wildcard $(OBJDIR)/*.input) $(wildcard $(OBJDIR)/*.h) $(wildcard $(OBJDIR)/*~) include $(topsrcdir)/config/rules.mk .SUFFIXES: .html .msg $(TR69): $(srcdir)/tr69.c @$(MAKE_OBJDIR) ifeq ($(OS_ARCH),OS2) $(CCF) -Fe $@ $< else $(CC) -o $@ $< endif # # Welcome to sHELL.... # # The awk command before the tee is for Windows, the one after the # tee is for Unix only. The about.pc file is for Win16, and the # about-java.pc is for Win32. They become .rc files with a trivial # tweak, if necessary. # # Mac: default # Win32: no Mercutio MDEF # Win16: no Mercutio MDEF # Unix: no Mercutio MDEF, no Macromedia, no Symantec, no Quicktime # $(OBJDIR)/about.h: $(srcdir)/about-all.html $(TR69) @echo generating $@ from $<; \ NAME=Netscape; \ CLASS=Netscape; \ RTMP=/tmp/nsrot$$$$; \ $(RM) $@ $*.pc; \ sed "s/@NAME@/$$NAME/g; \ s/@CLASS@/$$CLASS/g; \ s/@PROGNAME@/$(PROGNAME)/g" $< | \ awk 'BEGIN { skipline = 0 } \ /Mercutio/ { next } { print }' | \ tee $$RTMP | \ awk 'BEGIN { skipline = 0 } \ /about:qtlogo/,/<\/TD>/ { skipline = 1; next } \ /about:mmlogo/,/<\/TD>/ { skipline = 1; next } \ /about:symlogo/,/<\/TD>/ { skipline = 1; next } \ skipline == 1 && $$1 !~ /<\/TD>/ { next } \ skipline == 1 && $$1 ~ /<\/TD>/ { skipline = 0; next } \ { print }' | \ tee splash.input | \ $(TR69) '[\001-\272]' '[\106-\377]' | \ od -b | \ sed 's/^[0-7][0-7]* *\(.*\)/\\\1/; \ s/ /\\/g; \ s/\(.*\)/ "\1"/; \ s/^ *"\\"$$//' >> $@; \ echo generating $*.pc from $<; \ $(EMACS) -batch -q -l $(REAL_XPDIR)/html-to-pc.el \ -f batch-html-to-pc $* $$RTMP $*.pc; \ echo; \ $(RM) $$RTMP $(OBJDIR)/about-java.h: $(srcdir)/about-all.html $(TR69) @echo generating $@ from $<; \ NAME=Netscape; \ CLASS=Netscape; \ RTMP=/tmp/nsrot$$$$; \ $(RM) $@ $*.pc; \ sed "s/@NAME@/$$NAME/g; \ s/@CLASS@/$$CLASS/g; \ s/@PROGNAME@/$(PROGNAME)/g" $< | \ awk 'BEGIN { skipline = 0 } \ /Mercutio/ { next } { print }' | \ tee $$RTMP | \ awk 'BEGIN { skipline = 0 } \ /about:qtlogo/,/<\/TD>/ { skipline = 1; next } \ /about:mmlogo/,/<\/TD>/ { skipline = 1; next } \ /about:symlogo/,/<\/TD>/ { skipline = 1; next } \ skipline == 1 && $$1 !~ /<\/TD>/ { next } \ skipline == 1 && $$1 ~ /<\/TD>/ { skipline = 0; next } \ { print }' | \ tee splash-java.input | \ $(TR69) '[\001-\272]' '[\106-\377]' | \ od -b | \ sed 's/^[0-7][0-7]* *\(.*\)/\\\1/; \ s/ /\\/g; \ s/\(.*\)/ "\1"/; \ s/^ *"\\"$$//' >> $@; \ echo generating $*.pc from $<; \ $(EMACS) -batch -q -l $(REAL_XPDIR)/html-to-pc.el \ -f batch-html-to-pc $* $$RTMP $*.pc; \ echo; \ $(RM) $$RTMP $(OBJDIR)/about-all.h: $(srcdir)/about-all.html $(TR69) @echo "Garbage file" > $@ $(OBJDIR)/splash.input: $(OBJDIR)/about.h $(OBJDIR)/splash-java.input: $(OBJDIR)/about-java.h $(OBJDIR)/splash.html: $(OBJDIR)/splash.input @echo generating $@ from $<... @sed 's|||g;s|||g' $< > $@ $(OBJDIR)/splash-java.html: $(OBJDIR)/splash-java.input @echo generating $@ from $<... @sed 's|||g;s|||g' $< > $@ $(OBJDIR)/splash-lite.html: $(OBJDIR)/about-lite.html @echo generating $@ from $<... @sed 's|||g;s|||g' $< > $@ $(OBJDIR)/splash-java-lite.html: $(OBJDIR)/about-java-lite.html @echo generating $@ from $<... @sed 's|||g;s|||g' $< > $@ $(OBJDIR)/about-lite.html: $(OBJDIR)/splash.input @echo generating $@ from $<... @sed 's/Communicator/Navigator/' $< > $@ $(OBJDIR)/about-java-lite.html: $(OBJDIR)/splash-java.input @echo generating $@ from $<... @sed 's/Communicator/Navigator/' $< > $@ # # Handle the rest of the HTML files. # $(OBJDIR)/%.h: %.html $(TR69) @echo generating $*.h from $<; \ NAME=Netscape; \ CLASS=Netscape; \ RTMP=/tmp/nsrot$$$$; \ $(RM) $*.h $*.pc; \ sed "s/@NAME@/$$NAME/g; \ s/@CLASS@/$$CLASS/g; \ s/@PROGNAME@/$(PROGNAME)/g" \ < $< > $$RTMP; \ $(TR69) < $$RTMP | \ od -b | \ sed 's/^[0-7][0-7]* *\(.*\)/\\\1/; \ s/ /\\/g; \ s/\(.*\)/ "\1"/; \ s/^ *"\\"$$//' >> $*.h; \ echo generating $*.pc from $<; \ $(EMACS) -batch -q -l $(REAL_XPDIR)/html-to-pc.el \ -f batch-html-to-pc $* $$RTMP $*.pc; \ echo; \ $(RM) $$RTMP $(OBJDIR)/%.h: %.msg $(TR69) @echo generating $*.h from $<; \ NAME=Netscape; \ CLASS=Netscape; \ $(RM) $*.h; \ RTMP=/tmp/nsrot$$$$; \ sed "s/@NAME@/$$NAME/g; \ s/@CLASS@/$$CLASS/g; \ s/@PROGNAME@/$(PROGNAME)/g" \ < $< > $$RTMP; \ $(TR69) '[\001-\272]' '[\106-\377]' < $$RTMP | \ od -b | sed 's/^[0-7][0-7]* *\(.*\)/\\\1/; \ s/ /\\/g;s/\(.*\)/ "\1"/;s/^ *"\\"$$//' \ >> $*.h; \ $(RM) $$RTMP $(TARGETS): Makefile export:: $(TARGETS)