Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Haskell
Cabal
Commits
fe678cf4
Commit
fe678cf4
authored
17 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
get the stub object files right
parent
0bb4c6a8
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Distribution/Simple/GHCMakefile.hs
+1
-1
1 addition, 1 deletion
Distribution/Simple/GHCMakefile.hs
Distribution/Simple/GHCMakefile.in
+1
-1
1 addition, 1 deletion
Distribution/Simple/GHCMakefile.in
with
2 additions
and
2 deletions
Distribution/Simple/GHCMakefile.hs
+
1
−
1
View file @
fe678cf4
-- DO NOT EDIT: change GHCMakefile.in, and run ../../mkGHCMakefile.sh
module
Distribution.Simple.GHCMakefile
where
{
makefileTemplate
=
unlines
[
"# -----------------------------------------------------------------------------"
,
"# Makefile template starts here."
,
""
,
"GHC_OPTS += -i$(odir)"
,
""
,
"# For adding options on the command-line"
,
"GHC_OPTS += $(EXTRA_HC_OPTS)"
,
""
,
"WAY_p_OPTS = -prof"
,
""
,
"ifneq
\"
$(way)
\"
\"\"
"
,
"way_ := $(way)_"
,
"_way := _$(way)"
,
"GHC_OPTS += $(WAY_$(way)_OPTS)"
,
"GHC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(osuf)"
,
"endif"
,
"osuf = $(way_)o"
,
"hisuf = $(way_)hi"
,
""
,
"HS_OBJS = $(patsubst %,$(odir)/%.$(osuf),$(subst .,/,$(modules)))"
,
"HS_IFS = $(patsubst %,$(odir)/%.$(hisuf),$(subst .,/,$(modules)))"
,
"C_OBJS = $(patsubst %.c,$(odir)/%.$(osuf),$(C_SRCS))"
,
""
,
"LIB = $(odir)/libHS$(package)$(_way).a"
,
""
,
"# Optionally include local customizations:"
,
"-include Makefile.local"
,
""
,
"# Rules follow:"
,
""
,
"MKSTUBOBJS = find $(odir) -name
'
*_stub.
o'
-print"
,
"# HACK ^^^ we tried to use $(wildcard), but apparently it fails due to "
,
"# make using cached directory contents, or something."
,
""
,
"all :: .depend $(LIB)"
,
""
,
".depend : $(MAKEFILE)"
,
"
\t
$(GHC) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(filter-out -split-objs, $(GHC_OPTS)) $(modules)"
,
"
\t
for dir in $(sort $(foreach mod,$(HS_OBJS) $(C_OBJS),$(dir $(mod)))); do
\\
"
,
"
\t\t
if test ! -d $$dir; then mkdir -p $$dir; fi
\\
"
,
"
\t
done"
,
""
,
"include .depend"
,
""
,
"ifneq
\"
$(filter -split-objs, $(GHC_OPTS))
\"
\"\"
"
,
"$(LIB) : $(HS_OBJS) $(C_OBJS)"
,
"
\t
(echo $(C_OBJS) `$(MKSTUBOBJS)`; find $(patsubst %.$(osuf),%_split,$(HS_OBJS)) -name '*.$(way_)o' -print) | xargs -s 30000 $(AR) q $(EXTRA_AR_ARGS) $@ "
,
"else"
,
"$(LIB) : $(HS_OBJS) $(C_OBJS)"
,
"
\t
echo $(C_OBJS) $(HS_OBJS) `$(MKSTUBOBJS)` | xargs -s 30000 $(AR) q $(EXTRA_AR_ARGS) $@ "
,
"endif"
,
""
,
"ifneq
\"
$(GHCI_LIB)
\"
\"\"
"
,
"ifeq
\"
$(way)
\"
\"\"
"
,
"all :: $(GHCI_LIB)"
,
""
,
"$(GHCI_LIB) : $(HS_OBJS) $(C_OBJS)"
,
"
\t
@$(RM) $@"
,
"
\t
$(LD) -r -x -o $@ $(EXTRA_LD_OPTS) $(HS_OBJS) `$(MKSTUBOBJS)` $(C_OBJS)"
,
"endif"
,
"endif"
,
""
,
"# suffix rules"
,
""
,
"ifneq
\"
$(odir)
\"
\"\"
"
,
"odir_ = $(odir)/"
,
"else"
,
"odir_ ="
,
"endif"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.hs"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.lhs
\t
"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"# The .hs files might be in $(odir) if they were preprocessed"
,
"$(odir_)%.$(osuf) : $(odir_)%.hs"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"$(odir_)%.$(osuf) : $(odir_)%.lhs"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.c"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -c $< -o $@"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.$(way_)s"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -c $< -o $@"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.S"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -c $< -o $@"
,
""
,
"$(odir_)%.$(way_)s : $(srcdir)/%.c"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -S $< -o $@"
,
""
,
"$(odir_)%.$(osuf)-boot : $(srcdir)/%.hs-boot"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(way_)hi-boot"
,
""
,
"$(odir_)%.$(osuf)-boot : $(srcdir)/%.lhs-boot"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(way_)hi-boot"
,
""
,
"%.$(hisuf) : %.$(osuf)"
,
"
\t
@if [ ! -f $@ ] ; then
\\
"
,
"
\t
echo Panic! $< exists, but $@ does not.;
\\
"
,
"
\t
exit 1;
\\
"
,
"
\t
else exit 0 ;
\\
"
,
"
\t
fi"
,
""
,
"%.$(way_)hi-boot : %.$(osuf)-boot"
,
"
\t
@if [ ! -f $@ ] ; then
\\
"
,
"
\t
echo Panic! $< exists, but $@ does not.;
\\
"
,
"
\t
exit 1;
\\
"
,
"
\t
else exit 0 ;
\\
"
,
"
\t
fi"
,
""
,
"$(odir_)%.$(hisuf) : %.$(way_)hc"
,
"
\t
@if [ ! -f $@ ] ; then
\\
"
,
"
\t
echo Panic! $< exists, but $@ does not.;
\\
"
,
"
\t
exit 1;
\\
"
,
"
\t
else exit 0 ;
\\
"
,
"
\t
fi"
,
""
,
"show:"
,
"
\t
@echo '$(VALUE)=
\"
$($(VALUE))
\"
'"
,
""
,
"clean ::"
,
"
\t
$(RM) $(HS_OBJS) $(C_OBJS) $(LIB) $(GHCI_LIB) $(HS_IFS) .depend"
,
"
\t
$(RM) -rf $(wildcard $(patsubst %.$(osuf), %_split, $(HS_OBJS)))"
,
"
\t
$(RM) $(wildcard $(patsubst %.$(osuf), %.o-boot, $(HS_OBJS)))"
,
"
\t
$(RM) $(wildcard $(patsubst %.$(osuf), %.hi-boot, $(HS_OBJS)))"
,
"
\t
$(RM) $(wildcard $(patsubst %.$(osuf), %_stub.o, $(HS_OBJS)))"
,
""
,
"ifneq
\"
$(strip $(WAYS))
\"
\"\"
"
,
"ifeq
\"
$(way)
\"
\"\"
"
,
"all clean ::"
,
"# Don't rely on -e working, instead we check exit return codes from sub-makes."
,
"
\t
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac;
\\
"
,
"
\t
for i in $(WAYS) ; do
\\
"
,
"
\t
echo
\"
== $(MAKE) way=$$i -f $(MAKEFILE) $@;
\"
;
\\
"
,
"
\t
$(MAKE) way=$$i -f $(MAKEFILE) --no-print-directory $(MFLAGS) $@ ;
\\
"
,
"
\t
if [ $$? -eq 0 ] ; then true; else exit $$x_on_err; fi;
\\
"
,
"
\t
done"
,
"
\t
@echo
\"
== Finished recursively making
\\
`$@' for ways: $(WAYS) ...
\"
"
,
"endif"
,
"endif"
,
""
]
[
"# -----------------------------------------------------------------------------"
,
"# Makefile template starts here."
,
""
,
"GHC_OPTS += -i$(odir)"
,
""
,
"# For adding options on the command-line"
,
"GHC_OPTS += $(EXTRA_HC_OPTS)"
,
""
,
"WAY_p_OPTS = -prof"
,
""
,
"ifneq
\"
$(way)
\"
\"\"
"
,
"way_ := $(way)_"
,
"_way := _$(way)"
,
"GHC_OPTS += $(WAY_$(way)_OPTS)"
,
"GHC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(osuf)"
,
"endif"
,
"osuf = $(way_)o"
,
"hisuf = $(way_)hi"
,
""
,
"HS_OBJS = $(patsubst %,$(odir)/%.$(osuf),$(subst .,/,$(modules)))"
,
"HS_IFS = $(patsubst %,$(odir)/%.$(hisuf),$(subst .,/,$(modules)))"
,
"C_OBJS = $(patsubst %.c,$(odir)/%.$(osuf),$(C_SRCS))"
,
""
,
"LIB = $(odir)/libHS$(package)$(_way).a"
,
""
,
"
RM = rm -f"
,
""
,
"
# Optionally include local customizations:"
,
"-include Makefile.local"
,
""
,
"# Rules follow:"
,
""
,
"MKSTUBOBJS = find $(odir) -name
\"
*_stub.
$(osuf)
\"
-print"
,
"# HACK ^^^ we tried to use $(wildcard), but apparently it fails due to "
,
"# make using cached directory contents, or something."
,
""
,
"all :: .depend $(LIB)"
,
""
,
".depend : $(MAKEFILE)"
,
"
\t
$(GHC) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(filter-out -split-objs, $(GHC_OPTS)) $(modules)"
,
"
\t
for dir in $(sort $(foreach mod,$(HS_OBJS) $(C_OBJS),$(dir $(mod)))); do
\\
"
,
"
\t\t
if test ! -d $$dir; then mkdir -p $$dir; fi
\\
"
,
"
\t
done"
,
""
,
"include .depend"
,
""
,
"ifneq
\"
$(filter -split-objs, $(GHC_OPTS))
\"
\"\"
"
,
"$(LIB) : $(HS_OBJS) $(C_OBJS)"
,
"
\t
@$(RM) $@"
,
"
\t
(echo $(C_OBJS) `$(MKSTUBOBJS)`; find $(patsubst %.$(osuf),%_split,$(HS_OBJS)) -name '*.$(way_)o' -print) | xargs -s 30000 $(AR) q $(EXTRA_AR_ARGS) $@ "
,
"else"
,
"$(LIB) : $(HS_OBJS) $(C_OBJS)"
,
"
\
t
@$(RM) $@"
,
"
\
t
echo $(C_OBJS) $(HS_OBJS) `$(MKSTUBOBJS)` | xargs -s 30000 $(AR) q $(EXTRA_AR_ARGS) $@ "
,
"endif"
,
""
,
"ifneq
\"
$(GHCI_LIB)
\"
\"\"
"
,
"ifeq
\"
$(way)
\"
\"\"
"
,
"all :: $(GHCI_LIB)"
,
""
,
"$(GHCI_LIB) : $(HS_OBJS) $(C_OBJS)"
,
"
\t
@$(RM) $@"
,
"
\t
$(LD) -r -x -o $@ $(EXTRA_LD_OPTS) $(HS_OBJS) `$(MKSTUBOBJS)` $(C_OBJS)"
,
"endif"
,
"endif"
,
""
,
"# suffix rules"
,
""
,
"ifneq
\"
$(odir)
\"
\"\"
"
,
"odir_ = $(odir)/"
,
"else"
,
"odir_ ="
,
"endif"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.hs"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.lhs
\t
"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"# The .hs files might be in $(odir) if they were preprocessed"
,
"$(odir_)%.$(osuf) : $(odir_)%.hs"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"$(odir_)%.$(osuf) : $(odir_)%.lhs"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(hisuf)"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.c"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -c $< -o $@"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.$(way_)s"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -c $< -o $@"
,
""
,
"$(odir_)%.$(osuf) : $(srcdir)/%.S"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -c $< -o $@"
,
""
,
"$(odir_)%.$(way_)s : $(srcdir)/%.c"
,
"
\t
@$(RM) $@"
,
"
\t
$(GHC) $(GHC_CC_OPTS) -S $< -o $@"
,
""
,
"$(odir_)%.$(osuf)-boot : $(srcdir)/%.hs-boot"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(way_)hi-boot"
,
""
,
"$(odir_)%.$(osuf)-boot : $(srcdir)/%.lhs-boot"
,
"
\t
$(GHC) $(GHC_OPTS) -c $< -o $@ -ohi $(basename $@).$(way_)hi-boot"
,
""
,
"%.$(hisuf) : %.$(osuf)"
,
"
\t
@if [ ! -f $@ ] ; then
\\
"
,
"
\t
echo Panic! $< exists, but $@ does not.;
\\
"
,
"
\t
exit 1;
\\
"
,
"
\t
else exit 0 ;
\\
"
,
"
\t
fi"
,
""
,
"%.$(way_)hi-boot : %.$(osuf)-boot"
,
"
\t
@if [ ! -f $@ ] ; then
\\
"
,
"
\t
echo Panic! $< exists, but $@ does not.;
\\
"
,
"
\t
exit 1;
\\
"
,
"
\t
else exit 0 ;
\\
"
,
"
\t
fi"
,
""
,
"$(odir_)%.$(hisuf) : %.$(way_)hc"
,
"
\t
@if [ ! -f $@ ] ; then
\\
"
,
"
\t
echo Panic! $< exists, but $@ does not.;
\\
"
,
"
\t
exit 1;
\\
"
,
"
\t
else exit 0 ;
\\
"
,
"
\t
fi"
,
""
,
"show:"
,
"
\t
@echo '$(VALUE)=
\"
$($(VALUE))
\"
'"
,
""
,
"clean ::"
,
"
\t
$(RM) $(HS_OBJS) $(C_OBJS) $(LIB) $(GHCI_LIB) $(HS_IFS) .depend"
,
"
\t
$(RM) -rf $(wildcard $(patsubst %.$(osuf), %_split, $(HS_OBJS)))"
,
"
\t
$(RM) $(wildcard $(patsubst %.$(osuf), %.o-boot, $(HS_OBJS)))"
,
"
\t
$(RM) $(wildcard $(patsubst %.$(osuf), %.hi-boot, $(HS_OBJS)))"
,
"
\t
$(RM) $(wildcard $(patsubst %.$(osuf), %_stub.o, $(HS_OBJS)))"
,
""
,
"ifneq
\"
$(strip $(WAYS))
\"
\"\"
"
,
"ifeq
\"
$(way)
\"
\"\"
"
,
"all clean ::"
,
"# Don't rely on -e working, instead we check exit return codes from sub-makes."
,
"
\t
@case '${MFLAGS}' in *-[ik]*) x_on_err=0;; *-r*[ik]*) x_on_err=0;; *) x_on_err=1;; esac;
\\
"
,
"
\t
for i in $(WAYS) ; do
\\
"
,
"
\t
echo
\"
== $(MAKE) way=$$i -f $(MAKEFILE) $@;
\"
;
\\
"
,
"
\t
$(MAKE) way=$$i -f $(MAKEFILE) --no-print-directory $(MFLAGS) $@ ;
\\
"
,
"
\t
if [ $$? -eq 0 ] ; then true; else exit $$x_on_err; fi;
\\
"
,
"
\t
done"
,
"
\t
@echo
\"
== Finished recursively making
\\
`$@' for ways: $(WAYS) ...
\"
"
,
"endif"
,
"endif"
,
""
]
}
This diff is collapsed.
Click to expand it.
Distribution/Simple/GHCMakefile.in
+
1
−
1
View file @
fe678cf4
...
...
@@ -30,7 +30,7 @@ RM = rm -f
# Rules follow:
MKSTUBOBJS = find $(odir) -name
'
*_stub.
o'
-print
MKSTUBOBJS = find $(odir) -name
"
*_stub.
$(osuf)"
-print
# HACK ^^^ we tried to use $(wildcard), but apparently it fails due to
# make using cached directory contents, or something.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment