* device/lib/pic16/Makefile.common.in: added $(MM) to fix `make clean`
[fw/sdcc] / device / include / Makefile.in
index f4c30613a808d602101cdb15020f981957cb3189..61944635febaad6d65073a24fd1e2604e918b8f0 100644 (file)
@@ -28,7 +28,7 @@ srcdir          = @srcdir@
 
 include_dir_suffix = @include_dir_suffix@
 
-sdcc_includedir    = $(datadir)/$(include_dir_suffix)
+sdcc_includedir    = $(DESTDIR)$(datadir)/$(include_dir_suffix)
 
 CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR)
 
@@ -37,10 +37,14 @@ CPPFLAGS        = @CPPFLAGS@ -I$(PRJDIR)
 # ------------------------------------------
 all:
 
-# Compiling and installing everything and runing test
-# ---------------------------------------------------
+# Compiling and installing everything and running test
+# ----------------------------------------------------
 install: all installdirs
        $(CP) -r asm *.h $(sdcc_includedir)
+       if [ "`grep pic16 ../../ports.build`" = pic16 ]; then \
+               $(CP) pic16/*.h $(sdcc_includedir)/pic16 ; \
+       fi
+       rm -rf `find $(sdcc_includedir) -type d -name 'CVS'`
 
 
 # Deleting all the installed files
@@ -63,6 +67,7 @@ installcheck:
 # ---------------------------------
 installdirs:
        [ -d $(sdcc_includedir) ] || mkdir -p $(sdcc_includedir)
+       [ -d $(sdcc_includedir)/pic16 ] || mkdir -p $(sdcc_includedir)/pic16
 
 
 # Creating dependencies