--- w3m-0.5.3.orig/Makefile.in	2011-01-04 10:22:18.000000000 +0100
+++ w3m-0.5.3/Makefile.in	2014-04-08 21:21:10.000000000 +0200
@@ -176,8 +176,20 @@ functable.c: funcname.tab mktable$(EXT)
 	./mktable$(EXT) 100 functable.tab > $@
 	-rm -f functable.tab
 
-mktable$(EXT): mktable.o dummy.o Str.o hash.o myctype.o
-	$(CC) $(CFLAGS) -o mktable mktable.o dummy.o Str.o hash.o myctype.o $(LDFLAGS) $(LIBS) $(GC_LIBS)
+Str-host.o:
+	$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c -o $@ $(srcdir)/Str.c
+
+hash-host.o:
+	$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c -o $@ $(srcdir)/hash.c
+
+myctype-host.o:
+	$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c -o $@ $(srcdir)/myctype.c
+
+mktable-host.o:
+	$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c -o $@ $(srcdir)/mktable.c
+
+mktable$(EXT): mktable-host.o dummy-host.o Str-host.o hash-host.o myctype-host.o
+	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o mktable mktable-host.o dummy-host.o Str-host.o hash-host.o myctype-host.o $(LDFLAGS_FOR_BUILD) $(LIBS) $(GC_LIBS)
 
 $(BOOKMARKER): w3mbookmark.o dummy.o $(ALIB)
 	$(CC) $(CFLAGS) -o $(BOOKMARKER) w3mbookmark.o dummy.o $(LDFLAGS) $(LIBS) $(EXT_LIBS)
@@ -194,6 +206,9 @@ inflate.o: inflate.c
 libwc/libwc.a: libwc
 libwc:
 	(cd libwc && $(MAKE) CC='$(CC0)' OPTS='$(OPTS)')
+
+dummy-host.o: entity.c
+	$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DDUMMY -c -o $@ $?
  
 dummy.o: entity.c
 	$(CC) $(CFLAGS) -DDUMMY -c -o $@ $?
