altos: create target pdclib directories before building
[fw/altos] / src / Makefile
index bdd3307a1a9df579dbf3144e685f53be62dd629f..2488cbab371e0efe992bf621c62feb639548aea2 100644 (file)
@@ -42,6 +42,11 @@ AVRDIRS=\
 
 SUBDIRS=
 
+ifeq ($(strip $(HAVE_PDCLIB)),yes)
+PDCLIB=pdclib
+CLEAN_PDCLIB=clean-pdclib
+endif
+
 ifeq ($(strip $(HAVE_SDCC)),yes)
 SUBDIRS+=$(SDCCDIRS)
 endif
@@ -92,7 +97,7 @@ uninstall:
 
 all-recursive: all-local
 
-all-local: altitude.h altitude-pa.h ao_kalman.h ao_whiten.h
+all-local: altitude.h altitude-pa.h ao_kalman.h ao_whiten.h $(PDCLIB)
 
 altitude.h: make-altitude
        nickle $< > $@
@@ -106,5 +111,11 @@ ao_kalman.h: make-kalman kalman.5c kalman_filter.5c load_csv.5c matrix.5c
 ao_whiten.h: make-whiten
        nickle $< > $@
 
-clean-local:
+clean-local: $(CLEAN_PDCLIB)
        rm -f altitude.h ao_kalman.h
+
+pdclib:
+       cd ../pdclib && mkdir -p opt/include opt/lib && make && make prefix=`pwd`/opt install
+
+clean-pdclib:
+       cd ../pdclib && make clean && rm -rf opt
\ No newline at end of file