aboutsummaryrefslogblamecommitdiffstats
path: root/XMakefile
blob: 23c47518faf9659ae5c45e44ad3b7ae23dc6bf55 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                      
                                                                               
                                                           

                                                                              
                                                           
                                                          
                                                                 
                                   
                                                                 
                                   
                
                                                                              





                                  
                     
                              
                 

                    
                                                  
                        

                                                       
 


                                                        


                          
                                   
                                                                        
                                             
                     
                                    

                                

     
                           

                                         
                                                                  







                                             



                                                     
 
                                          




                           
                                                             

                         
                                                              

                         
                                                              
 




                                                                
                                                   
                                                                              

                                                
                                                                           

                                               
                                                                          
 
                     
                                                                              



                                                


                                                                  
 
                                
                                                       
 


                                                                  
                                                
                                                                             

                                            
                                                                           

                              
                                                                    

                                                                                     
                                                                        
 
        
                                                                                                                                     
 
 


                                     
                                      
                                         
                                      


                                          
                                                                   


                                                                          
                                                             
            
                                

                                                                                                 
                       
            

                                     
                                                                        

            

                 




                                                                      
 
            
                                         
                 
                                                                                                                                                                                                 

            
                            
                       
                                         
                 
                                                                                                                                                                                                                                                         

            
          
                                   




                                             






                                           


                                            

                                         
                                                                                                                                      
            

            
                                               
                                                                        
                                       
                                         


                                            













                                                                                                                                                     
# $Id: XMakefile,v 1.36 2003/02/12 17:22:33 ukai Exp $
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\
	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\
	func.o cookie.o history.o backend.o $(KEYBIND_OBJ)
LSRCS=terms.c conv.c url.c ftp.c anchor.c mimehead.c parsetagx.c\
	tagtable.c istream.c news.c
LOBJS=terms.o conv.o url.o ftp.o anchor.o mimehead.o parsetagx.o\
	tagtable.o istream.o news.o
LLOBJS=version.o
ALIBOBJS=Str.o indep.o regex.o textlist.o parsetag.o myctype.o entity.o hash.o
ALIB=libindep.a
ALLOBJS=$(OBJS) $(LOBJS) $(LLOBJS)

TARGET=w3m$(EXT)
BOOKMARKER=w3mbookmark$(EXT)
HELPER=w3mhelperpanel$(EXT)
INFLATE=inflate$(EXT)
IMGDISPLAY=w3mimgdisplay$(EXT)
MAN1_TARGET=w3m.1
MAN1=doc/w3m.1
MAN1_JA=doc-jp/w3m.1
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)

INCLUDES=-I.

DEFS=$(INCLUDES) # -DDEBUG
CFLAGS=$(OPTS) $(MYCFLAGS) $(DEFS) 
LIBS=-L. -lindep $(GCLIB) $(MATHLIB) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES)
LIBS2=-L. -lindep $(GCLIB) $(LOCAL_LIBRARIES)
INSTALL=sh install-sh
INSTALL_PROGRAM=$(INSTALL) -m 755 -s
INSTALL_SCRIPT=$(INSTALL) -m 755
INSTALL_DATA=$(INSTALL) -m 644
AR=ar

all: $(TARGETS) all-scripts

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

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

$(OBJS): fm.h funcname1.h

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

# entity.h: html.h entity.tab mktable$(EXT)
#	./mktable 100 entity.tab > entity.h

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 funcname.tab | awk -f funcname0.awk > funcname.c

funcname1.h: funcname.tab
	sort funcname.tab | awk -f funcname1.awk > funcname1.h

funcname2.h: funcname.tab
	sort funcname.tab | awk -f funcname2.awk > funcname2.h

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

mktable$(EXT): mktable.o hash.o $(ALIB) $(GCTARGET)
	$(CC) $(CFLAGS) $(LDFLAGS) -o mktable$(EXT) mktable.o hash.o  $(LIBS2)

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

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

$(INFLATE): inflate.o
	$(CC) $(CFLAGS) $(Z_CFLAGS) $(LDFLAGS) -o $(INFLATE) inflate.o $(ZLIB)

inflate.o: inflate.c
	$(CC) $(CFLAGS) $(Z_CFLAGS) -c inflate.c

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

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

w3mimg/w3mimg.o: w3mimg/w3mimg.c
	cd w3mimg && $(CC) $(CFLAGS) $(IMGCFLAGS) -I.. -c w3mimg.c

w3mimg/x11/x11_w3mimg.o: w3mimg/x11/x11_w3mimg.c
	cd w3mimg/x11 && $(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c x11_w3mimg.c

w3mimg/fb/fb_w3mimg.o: w3mimg/fb/fb_w3mimg.c
	cd w3mimg/fb && $(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c fb_w3mimg.c

w3mimg/fb/fb.o: w3mimg/fb/fb.c
	cd w3mimg/fb && $(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c fb.c

w3mimg/fb/fb_img.o: w3mimg/fb/fb_img.c w3mimg/fb/fb_gdkpixbuf.c w3mimg/fb/fb_imlib2.c
	cd w3mimg/fb && $(CC) $(CFLAGS) $(IMGCFLAGS) -I../.. -c fb_img.c

gc/gc.a:
	cd gc; $(MAKE) base_lib gc.a CC='$(CC)' CFLAGS='$(GCCFLAGS) $(GC_CFLAGS)' SPECIALCFLAGS='-I./\$(srcdir)/include $(GC_CFLAGS)'


install: install-core install-scripts

install-core: $(TARGETS)
	-$(MKDIR) $(DESTDIR)$(BIN_DIR)
	-$(MKDIR) $(DESTDIR)$(AUXBIN_DIR)
	-$(MKDIR) $(DESTDIR)$(LIB_DIR)
	-$(MKDIR) $(DESTDIR)$(HELP_DIR)
	-$(MKDIR) $(DESTDIR)$(MAN1_DIR)
	-$(MKDIR) $(DESTDIR)$(MAN1_JA_DIR)
	$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(BIN_DIR)/$(TARGET)
	$(INSTALL_DATA) $(HELP_FILE) $(DESTDIR)$(HELP_DIR)/$(HELP_TARGET)
	$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1_DIR)/$(MAN1_TARGET)
	$(INSTALL_DATA) $(MAN1_JA) $(DESTDIR)$(MAN1_JA_DIR)/$(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)$(LIB_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 $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' AUXBIN_DIR='$(AUXBIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' RC_DIR='$(RC_DIR)' KEYBIND_SRC='$(KEYBIND_SRC)');	\
	done

install-scripts: all-scripts
	topdir=`pwd`; \
	for dir in $(SCRIPTSUBDIRS);	\
	do	\
		(cd $$dir; $(MAKE) PERL='$(PERL)' MKDIR='$(MKDIR)' BIN_DIR='$(BIN_DIR)' AUXBIN_DIR='$(AUXBIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' DESTDIR='$(DESTDIR)' INSTALL="sh $$topdir/install-sh" install);	\
	done

uninstall:
	-rm -f $(BIN_DIR)/$(TARGET)
	-for file in $(AUXBIN_TARGETS); \
	do \
		rm -f $(AUXBIN_DIR)/$$file; \
	done
	-for file in $(LIB_TARGETS); \
	do \
		rm -f $(LIB_DIR)/$$file; \
	done
	-for file in $(HELP_ALLFILES); \
	do \
		rm -f $(HELP_DIR)/$$file; \
	done
	-rm -f $(HELP_DIR)/$(HELP_TARGET)
	-rm -f $(MAN1_DIR)/$(MAN1_TARGET)
	-rm -f $(MAN1_JA_DIR)/$(MAN1_TARGET)
	-for dir in $(SCRIPTSUBDIRS);	\
	do	\
		(cd $$dir; $(MAKE) BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' 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 $$dir; $(MAKE) clean); \
	done

sweep:
	-rm -f core *~ *.bak *.orig *.rej

depend: 
	makedepend $(CFLAGS) *.c

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

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

# DO NOT DELETE