From: Axel S. <as...@us...> - 2004-10-27 13:22:18
|
Update of /cvsroot/gtk2hs/gtk2hs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24829 Modified Files: ChangeLog Makefile.am Log Message: Enhance makefile so that it builds the library. Changed .chspp to .chs.cpp in all pre-processed chs files. Build with ghc --make the first time and with ghc -c on incremental changes. Index: Makefile.am =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 25 Oct 2004 08:49:40 -0000 1.2 +++ Makefile.am 27 Oct 2004 13:21:38 -0000 1.3 @@ -1,6 +1,7 @@ AUTOMAKE_OPTIONS = foreign subdir-objects - -SUFFIXES = .chspp .chs .hsc +SUFFIXES = .chs.cpp .chs .hsc +CLEANFILES = $(DEPDIR)*.dep +DISTCLEANFILES = *.precomp SOURCEDIRS = gtk/general gtk/glib gtk/pango gtk/treeList gtk/multiline \ gtk/gdk gtk/abstract gtk/display gtk/entry gtk/misc gtk/multiline \ @@ -12,13 +13,9 @@ CHSDEPEND = $(srcdir)/mk/chsDepend -HSC = hsc2hs +DEPDIR = $(addsuffix /,@DEPDIR@) -# Flags for the C compiler and C pre-processor. -# *_CFLAGS variables contain general flags for the C compiler. A subset of -# these, namely just the -I flags, are always available in *_CPPFLAGS. -# Breaking this convention is the automake built-in AM_CPPFLAGS to which -# no AM_CFLAGS exit. +HSC = hsc2hs # While building lib<name>, set the variable NAME to <name> so we can access # the package-specific variable <name>_HEADER, <name>_PACKAGE, etc. The @@ -181,18 +178,23 @@ libgtk2hs_a_CHSFILES_HS = $(patsubst %.chs,%.hs,\ $(patsubst %.chspp,%.hs,$(libgtk2hs_a_CHSFILES))) libgtk2hs_a_HSCFILES = $(filter %.hsc, $(libgtk2hs_a_SOURCES)) +libgtk2hs_a_HSCFILES_HS = $(libgtk2hs_a_HSCFILES:.hsc=.hs) libgtk2hs_a_BUILDSOURCES = \ $(libgtk2hs_a_CHSFILES_HS) \ - $(libgtk2hs_a_HSCFILES:.hsc=.hs) + $(libgtk2hs_a_HSCFILES_HS) libgtk2hs_a_HSFILES = \ $(libgtk2hs_a_BUILDSOURCES) \ $(filter %.hs,$(libgtk2hs_a_SOURCES)) +MOSTLYCLEANFILES = $(libgtk2hs_a_HSFILES:.hs=.$(OBJEXT)) +CLEANFILES+= $(libgtk2hs_a_BUILDSOURCES) - - - +# A file with CPP defines that reflect the current configuration. CONFIG_H = config.h +# The local GHC package file for compiling files that depend on packages +# that we have built but not yet installed. +LOCALPACKAGE = localpackages.conf + EMPTY = SPACE = $(EMPTY) $(EMPTY) VPATH = $(subst $(SPACE),:,$(strip \ @@ -202,8 +204,8 @@ BUILDSOURCES = $(libgtk2hs_a_BUILDSOURCES) .hs.o: $(CONFIG_H) - if test -f .depend; then \ - $(strip $(HC) -c $< -o $@ $($(NAME)_HCFLAGS) -i$(VPATH) \ + if test -f $(DEPDIR)$(NAME).dep; then \ + $(strip $(HC) -c $< -o $@ $($(NAME)_HCFLAGS) -i$(VPATH) \ $(addprefix -package ,$($(NAME)_PACKAGEDEPS)) \ $(addprefix -package-name ,$($(NAME)_PACKAGE)) \ $(addprefix '-\#include<,$(addsuffix >',$(CONFIG_H) \ @@ -212,13 +214,21 @@ ; else \ $(MAKE) $(AM_MAKEFLAGS) NAME="$(NAME)" $($(NAME)_BUILDSOURCES) \ && \ - $(strip $(HC) -M $(addprefix -optdep,-f .depend) \ + $(strip $(HC) -M $(addprefix -optdep,-f $(DEPDIR)$(NAME).dep) \ $($(NAME)_HCFLAGS) -i$(VPATH) \ $(addprefix -package ,$($(NAME)_PACKAGEDEPS)) \ $(addprefix '-\#include<,$(addsuffix >',$(CONFIG_H) \ $($(NAME)_EXTRA_HFILES))) \ $(AM_CPPFLAGS) $($(NAME)_EXTRA_CPPFLAGS) $($(NAME)_CPPFLAGS) \ $($(NAME)_HSFILES)) \ + && \ + $(strip $(HC) --make $($(NAME)_TOPLEVEL) \ + $($(NAME)_HCFLAGS) -i$(VPATH) \ + $(addprefix -package ,$($(NAME)_PACKAGEDEPS)) \ + $(addprefix -package-name ,$($(NAME)_PACKAGE)) \ + $(addprefix '-\#include<,$(addsuffix >',$(CONFIG_H) \ + $($(NAME)_EXTRA_HFILES))) \ + $(AM_CPPFLAGS) $($(NAME)_EXTRA_CPPFLAGS) $($(NAME)_CPPFLAGS))\ ; fi .o.hi: @@ -235,7 +245,7 @@ $(addprefix -C,$($(NAME)_CFLAGS) $($(NAME)_CPPFLAGS)) \ --precomp=$($(NAME)_PRECOMP) $($(NAME)_HEADER)) -.chspp.chs: $(CONFIG_H) +.chs.cpp.chs: $(CONFIG_H) $(strip $(HSCPP) $(AM_CPPFLAGS) \ $($(NAME)_EXTRA_CPPFLAGS) $($(NAME)_CPPFLAGS) \ $($(NAME)_EXTRA_CFLAGS) $($(NAME)_CFLAGS) \ @@ -259,7 +269,8 @@ -i$(VPATH) --precomp=$($(NAME)_PRECOMP) -o $@ $<) $(CHSDEPEND) -i$(VPATH) $< --include .depend *.dep + +-include $(DEPDIR)*.dep # $(ECHO) no header file associated with $@ Index: ChangeLog =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/ChangeLog,v retrieving revision 1.230 retrieving revision 1.231 diff -u -d -r1.230 -r1.231 --- ChangeLog 25 Oct 2004 08:49:39 -0000 1.230 +++ ChangeLog 27 Oct 2004 13:21:37 -0000 1.231 @@ -1,3 +1,13 @@ +2004-10-27 Axel Simon <A....@ke...> + + * mk/mkDepend.in: Redirect dependencies into .dep/ directory. + + * Makefile.am: Now builds libgtk2hs.a. Managed to define rule to + turn .chs.cpp into .chs, hence renamed all files that need to be + pre-processed. + + * gtk/*/*.chspp: Renamed to .chs.cpp + 2004-10-25 Axel Simon <A....@ke...> * configure.ac: Don't update mk/config.mk.in which no longer |