Added documentation install targets
[fw/sdcc] / Makefile
index 05599e9bda359e3450119907d10b26878d6eff2b..5a02a6d936a53be4f1fa7b94d9d07682b158f3cd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,21 +2,45 @@
 #
 #
 
+CFLAGS+=-g
+
 SHELL          = /bin/sh
 AUTOCONF       = autoconf
 
 PRJDIR         = .
-SDCC_MISC      = debugger/mcs51 sim/ucsim binutils-2.9.5.0.13
-SDCC_LIBS      = support/cpp
+srcdir          = .
+include $(srcdir)/Makefile.common
+
+SDCC_MISC      = debugger/mcs51 sim/ucsim
+SDCC_LIBS      = support/cpp support/cpp2
+SDCC_DOC        = doc
+
 SDCC_ASLINK    = as/mcs51 as link
+SDCC_PACKIHX   = packihx
 
-PKGS           = $(SDCC_MISC) $(SDCC_LIBS) $(SDCC_ASLINK) \
-                 src device/include device/lib
-PKGS_TINI      = $(SDCC_LIBS) $(SDCC_ASLINK) \
-                 src device/include
-PORTS          = mcs51 z80
+TARGETS         = sdcc-libs sdcc-cc sdcc-aslink sdcc-doc
 
-srcdir          = .
+PKGS           = $(SDCC_LIBS) src $(SDCC_ASLINK) $(SDCC_DOC)
+
+ifneq ($(OPT_ENABLE_UCSIM), no)
+TARGETS         += sdcc-misc 
+PKGS            += $(SDCC_MISC)
+endif
+
+ifneq ($(OPT_ENABLE_DEVICE_LIB_BUILD), no)
+TARGETS         += sdcc-device
+PKGS            += device/include device/lib
+endif
+
+ifneq ($(OPT_ENABLE_PACKIHX), no)
+TARGETS         += sdcc-packihx
+PKGS            += $(SDCC_PACKIHX)
+endif
+
+PKGS_TINI      = $(SDCC_LIBS) $(SDCC_ASLINK) \
+                 src device/include $(SDCC_PACKIHX)
+PORTS          = $(shell cat ports.build)
+ALLPORTS       = $(shell cat ports.all)
 
 # Compiling entire program or any subproject
 # ------------------------------------------
@@ -25,11 +49,6 @@ all: checkconf sdcc
 tini: checkconf sdcc-tini
 
 sdcc-libs:
-ifeq ($(CROSS_LIBGC),1)
-       $(MAKE) -C support/gc -f Makefile.cross
-else
-       $(MAKE) -C support/gc
-endif
        for lib in $(SDCC_LIBS); do $(MAKE) -C $$lib; done
 
 sdcc-cc: sdcc-libs
@@ -41,6 +60,9 @@ sdcc-aslink:
 sdcc-misc:
        for misc in $(SDCC_MISC); do $(MAKE) -C $$misc; done
 
+sdcc-packihx:
+       $(MAKE) -C $(SDCC_PACKIHX)
+
 sdcc-device:
        $(MAKE) -C device/include
        $(MAKE) -C device/lib
@@ -49,10 +71,12 @@ sdcc-device-tini:
        $(MAKE) -C device/include
        $(MAKE) -C device/lib modelDS390
 
-sdcc: sdcc-cc sdcc-aslink sdcc-misc sdcc-device
-       $(MAKE) -f main.mk all
+# Empty for now, as doc depends on latex and latex2html
+sdcc-doc:
+
+sdcc: $(TARGETS)
 
-sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini
+sdcc-tini: sdcc-cc sdcc-aslink sdcc-device-tini sdcc-packihx
        $(MAKE) -f main.mk all
 
 # Some interesting sub rules