-.SUFFIXES: .cc .o .hh .yy .ll .dep
+.SUFFIXES: .cc .dep .hh .ll .o .so .yy
-# compile rules:
-#
$(outdir)/%.o: %.cc
- $(DO_CXX_COMPILE)
+ $(DO_O_DEP) $(CXX) -c $(ALL_CXXFLAGS) -o $@ $<
$(outdir)/%.o: $(outdir)/%.cc
- $(DO_CXX_COMPILE)
+ $(DO_O_DEP) $(CXX) -c $(ALL_CXXFLAGS) -o $@ $<
+
+$(outdir)/%.lo: %.cc
+ $(DO_LO_DEP) $(CXX) -c $(ALL_CXXFLAGS) $(PIC_FLAGS) -o $@ $<
+
+$(outdir)/%.lo: $(outdir)/%.cc
+ $(DO_LO_DEP) $(CXX) -c $(ALL_CXXFLAGS) $(PIC_FLAGS) -o $@ $<
$(outdir)/%.cc: %.yy
- $(BISON) $<
- mv $<.tab.c $@
+ $(BISON) -o $@ $<
+ -mv -f $(*F).yy.tab.c $@ # bison < 1.30
$(outdir)/%.hh: %.yy
- $(BISON) -d $<
- mv $<.tab.h $@
- rm $<.tab.c # if this happens in the wrong order it triggers recompile of the .cc file
+ $(BISON) -o$(outdir)/$(*F).cc -d $<
+ -mv -f $(*F).yy.tab.h $@ # bison < 1.30 ???
+ -mv -f $(outdir)/$(*F).cc.h $@ # bison < 1.30
+ -mv $(*F).tab.hh $@
+ rm -f $(*F).tab.c $(*F).tab.cc # bison < 1.30
+ rm -f $(outdir)/$(*F).cc # avoid recompiling the .cc file
$(outdir)/%.cc: %.ll
- $(FLEX) -Cfe -p -p -t $< > $@
+ $(FLEX) -Cfe -p -p -o$@ $<