aboutsummaryrefslogblamecommitdiffstats
path: root/Makefile.in
blob: ba04e0d46547406c14b1d1670506cf21f95f13cb (plain) (tree)
1
2
3
4
5
6



                   

             
















                                 
                       

          



                                             

                                   
 
                                 
                     
                     

                                                                  

                                                             

                         
                     
                     
 


                                                                  

                                                                         

                                                                            







                                           
     










                                             

                         
                             


                                                                               
                                                                         


                                                                              
                                                                         
                                                          

                                               
                
                                                                     





                                  
                       



                              
                        














                                                       
                                         
                                                                              






                                    
                                              
                                                       






                                          
                                                                                

                         
                                                                                

                         
                                                                                

                                       
                                                                                           
                                              

                            

                                                                       
 

                                                                                 
 

                                                                                




                                                                      
                                                    
 








                                                           



                                                                                                    
                                                                       

                                




                                                             

                                                




                                                                             

                                            




                                                                         

                              




                                                            

                                                                                     




                                                                   




                                     


                                         


                                                                  
                                                                         




                                                                             


                                                                               



                                     
                                                                           


                 
                                       

                                       
                                                                      




                                         
                                                                   





                                         
                                                                           





                                         
                                                


                                      
                                                


                                        
                                              
            
                                            



                                                  
                                                                             







                                                                           
                                                            

            





                                                        
                       












                                                                                                           
#
# Makefile
# @configure_input@
#
@SET_MAKE@
SHELL=@SHELL@
package=w3m
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
infodir = @infodir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
top_srcdir = @top_srcdir@
VPATH = $(top_srcdir):.
DESTDIR = 

CGIBIN_DIR = $(libexecdir)/$(package)/cgi-bin
AUXBIN_DIR = $(libexecdir)/$(package)
HELP_DIR = $(datadir)/$(package)
RC_DIR = ~/.$(package)
ETC_DIR = $(sysconfdir)
CONF_DIR = $(sysconfdir)/$(package)

CFLAGS = $(OPTS) @CFLAGS@ $(DEFS)
WCCFLAGS = @WCCFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@ -I. -I$(top_srcdir) -DAUXBIN_DIR=\"$(AUXBIN_DIR)\" \
	-DLIB_DIR=\"$(CGIBIN_DIR)\" -DHELP_DIR=\"$(HELP_DIR)\" \
	-DETC_DIR=\"$(ETC_DIR)\" -DCONF_DIR=\"$(CONF_DIR)\" \
	-DRC_DIR=\"$(RC_DIR)\"
LDFLAGS = @LDFLAGS@
LIBS = -L. -lindep @LIBS@
W3M_LIBS = @W3M_LIBS@
WCTARGET = @WCTARGET@

MAKE_ARGS = PERL='$(PERL)' MKDIR='$(MKDIR)' INSTALL='$(INSTALL)' \
	BIN_DIR='$(bindir)' AUXBIN_DIR='$(AUXBIN_DIR)' \
	LIB_DIR='$(CGIBIN_DIR)' \
	HELP_DIR='$(HELP_DIR)' MAN_DIR='$(mandir)' ETC_DIR='$(ETC_DIR)' \
	CONF_DIR='$(CONF_DIR)' \
	RC_DIR='$(RC_DIR)' DESTDIR='$(DESTDIR)' KEYBIND_SRC='$(KEYBIND_SRC)'

IMGCFLAGS = @IMGX11CFLAGS@ @IMGFBCFLAGS@
IMGLDFLAGS = @IMGX11LDFLAGS@ @IMGFBLDFLAGS@

CC = @CC@
RANLIB=@RANLIB@
AWK = @AWK@
PERL = @PERL@
MKDIR=mkdir -p
MV=mv
RM=rm
AR=ar
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_SCRIPT=@INSTALL_SCRIPT@
INSTALL_DATA=@INSTALL_DATA@
INSTALL_W3MIMGDISPLAY=@INSTALL_W3MIMGDISPLAY@

HELP_FILE = @HELP_FILE@
KEYBIND_SRC = @KEYMAP_FILE@.c
KEYBIND_OBJ = @KEYMAP_FILE@.o

VERSION=@CURRENT_VERSION@
MODEL=@W3M_TARGET@-@W3M_LANG@

SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \
	form.c map.c frame.c rc.c menu.c mailcap.c image.c \
	symbol.c entity.c terms.c url.c ftp.c mimehead.c regex.c news.c \
	func.c cookie.c history.c backend.c $(KEYBIND_SRC)
OBJS=main.o file.o buffer.o display.o etc.o search.o linein.o table.o local.o\
	form.o map.o frame.o rc.o menu.o mailcap.o image.o \
	symbol.o entity.o terms.o url.o ftp.o mimehead.o regex.o news.o \
	func.o cookie.o history.o backend.o $(KEYBIND_OBJ)
LSRCS=anchor.c parsetagx.c tagtable.c istream.c
LOBJS=anchor.o parsetagx.o tagtable.o istream.o
LLOBJS=version.o
ALIBOBJS=Str.o indep.o regex.o textlist.o parsetag.o myctype.o hash.o
ALIB=libindep.a
ALLOBJS=$(OBJS) $(LOBJS) $(LLOBJS)
IMGOBJS=@IMGOBJS@

EXT=@EXEEXT@

TARGET=$(package)$(EXT)
BOOKMARKER=w3mbookmark$(EXT)
HELPER=w3mhelperpanel$(EXT)
INFLATE=inflate$(EXT)
IMGDISPLAY=w3mimgdisplay$(EXT)
MAN1_TARGET=$(package).1
MAN1=doc/w3m.1
MAN1_JA=doc-jp/w3m.1

LIB_TARGETS=$(BOOKMARKER) $(HELPER)
AUXBIN_TARGETS=@AUXBIN_TARGETS@
TARGETS=$(TARGET) $(LIB_TARGETS) $(AUXBIN_TARGETS)
HELP_TARGET=w3mhelp.html
HELP_ALLFILES=w3mhelp-w3m_en.html w3mhelp-w3m_ja.html \
	w3mhelp-lynx_en.html w3mhelp-lynx_ja.html

SCRIPTSUBDIRS= scripts scripts/multipart scripts/w3mman
SUBDIRS = $(SCRIPTSUBDIRS)

all: $(TARGETS) all-scripts

$(TARGET): $(ALLOBJS) $(ALIB) $(WCTARGET)
	$(CC) $(CFLAGS) -o $(TARGET) $(ALLOBJS) $(LDFLAGS) $(LIBS) $(W3M_LIBS)

$(ALIB): $(ALIBOBJS)
	$(AR) rv $(ALIB) $(ALIBOBJS)
	$(RANLIB) $(ALIB)

$(OBJS): fm.h funcname1.h

tagtable.c: tagtable.tab mktable$(EXT) html.h 
	./mktable$(EXT) 100 $(srcdir)/tagtable.tab > $@

func.o: funcname.c functable.c funcname1.h
keybind.o: funcname2.h
keybind_lynx.o: funcname2.h
parsetagx.o: html.c

funcname.c: funcname.tab
	sort $(srcdir)/funcname.tab | $(AWK) -f $(top_srcdir)/funcname0.awk > $@

funcname1.h: funcname.tab
	sort $(srcdir)/funcname.tab | $(AWK) -f $(top_srcdir)/funcname1.awk > $@

funcname2.h: funcname.tab
	sort $(srcdir)/funcname.tab | $(AWK) -f $(top_srcdir)/funcname2.awk > $@

functable.c: funcname.tab mktable$(EXT)
	sort $(srcdir)/funcname.tab | $(AWK) -f $(top_srcdir)/functable.awk > functable.tab
	./mktable$(EXT) 100 functable.tab > $@
	-rm -f functable.tab

mktable$(EXT): mktable.o dummy.o $(ALIB) $(GCTARGET)
	$(CC) $(CFLAGS) -o mktable mktable.o dummy.o $(LDFLAGS) $(LIBS)

$(BOOKMARKER): w3mbookmark.o dummy.o $(ALIB) $(GCTARGET)
	$(CC) $(CFLAGS) -o $(BOOKMARKER) w3mbookmark.o dummy.o $(LDFLAGS) $(LIBS)

$(HELPER): w3mhelperpanel.o dummy.o $(ALIB) $(GCTARGET)
	$(CC) $(CFLAGS) -o $(HELPER) w3mhelperpanel.o dummy.o $(LDFLAGS) $(LIBS)

$(INFLATE): inflate.o
	$(CC) $(CFLAGS) -o $(INFLATE) inflate.o $(LDFLAGS) $(LIBS) -lz

inflate.o: inflate.c
	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/inflate.c

wctarget:
	cd libwc; $(MAKE) \
		CC='$(CC)' CFLAGS='$(WCCFLAGS) $(CFLAGS)' \
		AR='$(AR)' \
		RANLIB='$(RANLIB)'
 
dummy.o: entity.c
	$(CC) $(CFLAGS) -DDUMMY -o $@ $?

$(IMGDISPLAY): w3mimgdisplay.o $(IMGOBJS)
	$(CC) $(CFLAGS) -o $(IMGDISPLAY) w3mimgdisplay.o $(IMGOBJS) $(LDFLAGS) $(LIBS) $(IMGLDFLAGS)

w3mimgdisplay.o: w3mimgdisplay.c
	$(CC) $(CFLAGS) $(IMGCFLAGS) -o $@ -c $(srcdir)/w3mimgdisplay.c

w3mimg/w3mimg.o: w3mimg/w3mimg.c
	-@$(MKDIR) w3mimg
	-@$(RM) -f $@
	cd $(top_srcdir)/w3mimg && \
		$(CC) $(CFLAGS) $(IMGCFLAGS) -I.. -c w3mimg.c
	-@$(MV) $(top_srcdir)/w3mimg/w3mimg.o w3mimg/w3mimg.o

w3mimg/x11/x11_w3mimg.o: w3mimg/x11/x11_w3mimg.c
	-@$(MKDIR) w3mimg/x11
	-@$(RM) -f $@
	cd $(top_srcdir)/w3mimg/x11 && \
		$(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c x11_w3mimg.c
	-@$(MV) $(top_srcdir)/w3mimg/x11/x11_w3mimg.o w3mimg/x11/x11_w3mimg.o

w3mimg/fb/fb_w3mimg.o: w3mimg/fb/fb_w3mimg.c
	-@$(MKDIR) w3mimg/fb
	-@$(RM) -f $@
	cd $(top_srcdir)/w3mimg/fb && \
		$(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c fb_w3mimg.c
	-@$(MV) $(top_srcdir)/w3mimg/fb/fb_w3mimg.o w3mimg/fb/fb_w3mimg.o

w3mimg/fb/fb.o: w3mimg/fb/fb.c
	-@$(MKDIR) w3mimg/fb
	-@$(RM) -f $@
	cd $(top_srcdir)/w3mimg/fb && \
		$(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c fb.c
	-@$(MV) $(top_srcdir)/w3mimg/fb/fb.o w3mimg/fb/fb.o

w3mimg/fb/fb_img.o: w3mimg/fb/fb_img.c w3mimg/fb/fb_gdkpixbuf.c w3mimg/fb/fb_imlib2.c
	-@$(MKDIR) w3mimg/fb
	-@$(RM) -f $@
	cd $(top_srcdir)/w3mimg/fb && \
		$(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c fb_img.c
	-@$(MV) $(top_srcdir)/w3mimg/fb/fb_img.o w3mimg/fb/fb_img.o

install: install-core install-scripts

install-core: $(TARGETS)
	-$(MKDIR) $(DESTDIR)$(bindir)
	-$(MKDIR) $(DESTDIR)$(AUXBIN_DIR)
	-$(MKDIR) $(DESTDIR)$(CGIBIN_DIR)
	-$(MKDIR) $(DESTDIR)$(HELP_DIR)
	-$(MKDIR) $(DESTDIR)$(mandir)/man1
	-$(MKDIR) $(DESTDIR)$(mandir)/ja/man1
	$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)/$(TARGET)
	$(INSTALL_DATA) $(HELP_FILE) $(DESTDIR)$(HELP_DIR)/$(HELP_TARGET)
	$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(mandir)/man1/$(MAN1_TARGET)
	$(INSTALL_DATA) $(MAN1_JA) $(DESTDIR)$(mandir)/ja/man1/$(MAN1_TARGET)
	targets="$(AUXBIN_TARGETS)"; for file in $$targets; \
	do \
		case $$file in \
		$(IMGDISPLAY)) $(INSTALL_W3MIMGDISPLAY) $$file \
			$(DESTDIR)$(AUXBIN_DIR)/$$file;; \
		*) $(INSTALL_PROGRAM) $$file $(DESTDIR)$(AUXBIN_DIR)/$$file;; \
		esac; \
	done
	for file in $(LIB_TARGETS); \
	do \
		$(INSTALL_PROGRAM) $$file $(DESTDIR)$(CGIBIN_DIR)/$$file; \
	done

install-helpfile:
	-$(MKDIR) $(DESTDIR)$(HELP_DIR)
	for file in $(HELP_ALLFILES); \
	do \
		$(INSTALL_DATA) $$file $(DESTDIR)$(HELP_DIR)/$$file; \
	done

all-scripts:
	for dir in $(SCRIPTSUBDIRS);	\
	do	\
		(cd $(top_srcdir)/$$dir && $(MAKE) $(MAKE_ARGS)); \
	done

install-scripts: all-scripts
	topdir=`pwd`; \
	for dir in $(SCRIPTSUBDIRS);	\
	do	\
		(cd $(top_srcdir)/$$dir && $(MAKE) $(MAKE_ARGS) install); \
	done

uninstall:
	-$(RM) $(bindir)/$(TARGET)
	-for file in $(AUXBIN_TARGETS); \
	do \
		$(RM) -f $(AUXBIN_DIR)/$$file; \
	done
	-for file in $(LIB_TARGETS); \
	do \
		$(RM) -f $(CGIBIN_DIR)/$$file; \
	done
	-for file in $(HELP_ALLFILES); \
	do \
		$(RM) -f $(HELP_DIR)/$$file; \
	done
	-$(RM) -f $(HELP_DIR)/$(HELP_TARGET)
	-$(RM) -f $(mandir)/man1/$(MAN1_TARGET)
	-$(RM) -f $(mandir)/ja/man1/$(MAN1_TARGET)
	-for dir in $(SCRIPTSUBDIRS);	\
	do	\
		(cd $(top_srcdir)/$$dir && $(MAKE) $(MAKE_ARGS) uninstall); \
	done

clean: sweep
	-$(RM) -f *.o *.a $(TARGETS) mktable$(EXT)
	-$(RM) -f funcname.c funcname1.h funcname2.h tagtable.c functable.c
	-$(RM) -f w3mimg/*.o w3mimg/*/*.o 
	-for dir in $(SCRIPTSUBDIRS);	\
	do	\
		(cd $(top_srcdir)/$$dir && $(MAKE) clean); \
	done

distclean: clean
	-$(RM) config.cache config.log config.status
	-$(RM) w3mhelp-w3m_en.html w3mhelp-w3m_ja.html
	-$(RM) w3mhelp-lynx_en.html w3mhelp-lynx_ja.html
	-$(RM) version.c
	-$(RM) config.h Makefile
	-$(RM) -f *core

sweep:
	-$(RM) -f core *~ *.bak *.orig *.rej

depend: 
	makedepend $(CFLAGS) *.c

dist:
	cd ..; tar cvfz w3m-$(VERSION).tar.gz w3m

bindist:
	cd ..; tar cvfz w3m-$(VERSION)-$(MODEL).tar.gz w3m/w3m* w3m/doc* w3m/Bonus* w3m/README w3m/scripts