From: Duncan C. <dun...@us...> - 2004-08-08 19:04:46
|
Update of /cvsroot/gtk2hs/gtk2hs/mk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv358/mk Modified Files: library.mk common.mk Log Message: Axel's patches to get the build to work for gtk-2.2, exclude new module bodies so c2hs doesn't see the new functions, and change the way _stub.o files are found so we don't try to link non-existant ones. Everything should build for gtk-2.0 and gtk-2.2 now. Index: common.mk =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/common.mk,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- common.mk 28 Jul 2004 02:40:07 -0000 1.29 +++ common.mk 8 Aug 2004 19:04:37 -0000 1.30 @@ -75,25 +75,6 @@ ALLSOURCEFILES := $(ALLCHSFILES) $(HSCFILES) $(HSFILES) \ $(EXTRA_HSFILES) -# Compile a list of all generated *_stub.o files. Such a file is generated if -# a sourcefile contains a foreign export declaration. If there is a standard -# grep for regexs, then we should match for the beginning of the line. Files -# specified with EXTRA_... cannot be scanned, thus these STUB files need to -# be specified explicitly through EXTRA_STUBFILES. -STUBOFILES := $(strip \ - $(patsubst %.hs,%_stub.o, $(foreach FILE,\ - $(HSFILES),$(shell $(GREP) -l "foreign export" $(FILE)))) \ - $(patsubst %.chs,%_stub.o, $(foreach FILE,\ - $(CHSFILES),$(shell $(GREP) -l "foreign export" $(FILE)))) \ - $(patsubst %.hsc,%_stub.o, $(foreach FILE,\ - $(HSCFILES),$(shell $(GREP) -l "foreign export" $(FILE))))\ - $(patsubst %.chs,%_stub.o, $(EXTRA_STUBFILES))) - -# Not needed at the moment: GHC with --make knows that it should pass these -# files to the C compiler. We only include the header file $(HEADER) and -# clean the tree through a wildcard. -STUBHFILES := $(STUBOFILES:.o=.h) - EXTRA_HFILESOK := $(sort $(EXTRA_HFILES) $(EXTRA_CFILES:.c=.h)) # C include file paths and other options to CPP. @@ -271,7 +252,8 @@ @echo Explicit header: $(EXPLICIT_HEADER) # @echo all HSC files: $(HSCFILES) # @echo all other HS files: $(HSFILES) -# @echo all files generating stubs: $(STUBOFILES) + @echo stub-o files: $(filter-out %*_stub.o,\ + $(shell echo $(addsuffix *_stub.o,$(SUBDIRSOK)))) @echo hi: $(INST_HIDIR) lib: $(INST_LIBDIR) @echo incl: $(INST_INCLDIR) bin: $(INST_BINDIR) # @echo user install dir: $(INSTALLDIR) @@ -345,7 +327,8 @@ mostlyclean : noinplace $(strip $(RM) $(TARGETOK) $(ALLHSFILES:.hs=.o) $(ALLHSFILES:.hs=.hi) \ - $(EXTRA_CFILES:.c=.o) $(ALLHSFILES:.hs=_stub.*) .depend) + $(EXTRA_CFILES:.c=.o) $(ALLHSFILES:.hs=_stub.*) .depend \ + $(ALLCHSFILES:.chs=.dep)) clean : mostlyclean $(strip $(RM) $(ALLCHSFILES:.chs=.hs) $(ALLCHSFILES:.chs=.chi) \ Index: library.mk =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/mk/library.mk,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- library.mk 28 Jul 2004 11:13:40 -0000 1.24 +++ library.mk 8 Aug 2004 19:04:37 -0000 1.25 @@ -34,8 +34,7 @@ include_dirs = [$(call makeTextList, $(INPL_INCLDIR)\ $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\ c_includes = [$(call makeTextList,\ - $(notdir $(STUBHFILES)) $(HEADER)\ - $(EXTRA_HFILESOK))],\ + $(HEADER) $(EXTRA_HFILESOK))],\ package_deps = [$(call makeTextList,$(NEEDPACKAGES))],\ extra_ghc_opts = [$(call makeTextList,$(EXTRAHC_FLAGS))],\ extra_cc_opts = [],\ @@ -66,8 +65,8 @@ $(INSTALL_DATA) $$file $(DESTDIR)$(INST_HIDIR); done; $(INSTALL_DATA) $(TARGETOK) $(DESTDIR)$(INST_LIBDIR) $(TOUCH) -r $(TARGETOK) $(DESTDIR)$(INST_LIBDIR)/$(TARGETOK) -ifneq ($(strip $(STUBHFILES) $(EXTRA_HFILESOK)),) - for file in $(STUBHFILES) $(EXTRA_HFILESOK); do \ +ifneq ($(strip $(EXTRA_HFILESOK)),) + for file in $(EXTRA_HFILESOK); do \ $(INSTALL_DATA) $$file $(DESTDIR)$(INST_INCLDIR); done; endif $(INSTALL_DATA) $(PACKAGENAME).conf $(DESTDIR)$(INST_LIBDIR) @@ -86,8 +85,7 @@ include_dirs = [$(call makeTextList, $(INST_INCLDIR)\ $(patsubst -I%,%,$(EXTRA_CPPFLAGS_ONLY_I)))],\ c_includes = [$(call makeTextList,\ - $(notdir $(STUBHFILES)) $(HEADER)\ - $(notdir $(EXTRA_HFILESOK)))],\ + $(HEADER) $(notdir $(EXTRA_HFILESOK)))],\ package_deps = [$(call makeTextList,$(NEEDPACKAGES))],\ extra_ghc_opts = [$(call makeTextList,$(EXTRAHC_FLAGS))],\ extra_cc_opts = [],\ @@ -108,8 +106,7 @@ uninstallfiles : $(RM) $(addprefix $(DESTDIR)$(INST_INCLDIR)/,$(notdir $(ALLHSFILES:.hs=.hi))) $(RM) $(addprefix $(DESTDIR)$(INST_LIBDIR)/,$(TARGETOK)) - $(RM) $(addprefix $(DESTDIR)$(INST_INCLDIR)/,$(notdir $(STUBHFILES)\ - ) $(EXTRA_CFILES:.c=.h)) + $(RM) $(addprefix $(DESTDIR)$(INST_INCLDIR)/,$(EXTRA_CFILES:.c=.h)) $(strip rmdir -p $(sort $(DESTDIR)$(INST_HIDIR) $(DESTDIR)$(INST_LIBDIR) \ $(DESTDIR)$(INST_INCLDIR)) 2> /dev/null || true) @@ -119,20 +116,23 @@ uninstallpackage : $(PKG) -r $(PACKAGENAME) -$(TARGETOK) : $(ALLHSFILES) $(EXTRA_CFILES:.c=$(OBJSUFFIX)) $(GHCILIBS:\ +.PHONY: compile +compile : $(ALLHSFILES) $(EXTRA_CFILES:.c=$(OBJSUFFIX)) $(GHCILIBS:\ $(LIBSUFFIX)=$(OBJSUFFIX)) $(GHCIOBJS) $(RM) $(PACKAGENAME).conf $(runC2HS) - $(RM) $@ $(strip $(HC) --make $(MAINOK) -package-name $(PACKAGENAME) \ -package-conf $(LOCALPKGCONF) $(HCINCLUDES) \ $(EXTRA_CPPFLAGS_ONLY_I) $(EXTRA_LIBS_ONLY_Ll) \ $(LIBS_ONLY_L) $(CPPFLAGS_ONLY_I) \ $(HC_FLAGS) $(EXTRAHC_FLAGS) -i$(HIDIRSOK) $(NEEDPACKAGESOK)) - $(strip $(AR) crs $@ $(STUBOFILES) $(ALLHSFILES:.hs=$(OBJSUFFIX)) \ - $(EXTRA_CFILES:.c=$(OBJSUFFIX))) -# $(STUBOFILES) $(addprefix -#include ,$(STUBHFILES)) +$(TARGETOK) : compile + $(RM) $@ + $(strip $(AR) crs $@ $(filter-out %*_stub.o,\ + $(shell echo $(addsuffix *_stub.o,$(SUBDIRSOK)))) \ + $(ALLHSFILES:.hs=$(OBJSUFFIX)) \ + $(EXTRA_CFILES:.c=$(OBJSUFFIX))) # GHCi handling # The current version of GHCi cannot load lib<blah>.a files. We have to convert |