Quantcast

HEAD: problems with suffix.mk for registerised hc-boot

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HEAD: problems with suffix.mk for registerised hc-boot

Reilly Hayes

The rules in suffix.mk don't seem to work for building in $(TOP)/
compiler/stage1 when building from .hc files.  Make dies complaining  
that it doesn't know how to build the .o file.

The relevant rules are:

--------
# with mangling

$(odir_)%.raw_s : %.hc
        $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I.  `echo $(patsubst -
monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $
($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'`

$(odir_)%.s : %.raw_s
        $(MANGLER) $< $@ $(patsubst -monly-%-regs, %, $(filter -monly-%-
regs, $($*_HC_OPTS)))

$(odir_)%.o : %.s
        $(CC) -c -o $@ $<
--------

The problem is that the dependency chain is broken when the source &  
build directory are different.  Assuming that .raw_s and .s files  
belong in the build directory (stage1, etc), I believe the rules  
should look like:

--------
# with mangling

$(odir_)%.raw_s : %.hc
        $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I.  `echo $(patsubst -
monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $
($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'`

$(odir_)%.s : $(odir_)%.raw_s
        $(MANGLER) $< $@ $(patsubst -monly-%-regs, %, $(filter -monly-%-
regs, $($*_HC_OPTS)))

$(odir_)%.o : $(odir_)%.s
        $(CC) -c -o $@ $<
--------

Reilly Hayes





_______________________________________________
Glasgow-haskell-bugs mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Loading...