# The ROS Top level Makefile
# Make sure that 'all' is the first target
+# Keep make quiet. Make sure you call make via $(MAKE), and not directly
+MAKE += -s
+
#############################################################################
########## Initial Setup so that we can build for different TARGETS #########
#############################################################################
# Default values for configurable Make system variables
COMPILER := GCC
OBJDIR := obj
-V := @
+V ?= @
# Make sure that 'all' is the first target when not erroring out
realall: symlinks
MAKE_JOBS :=
# Give it a reasonable default path for initramfs to avoid build breakage
-INITRAMFS_PATHS = kern/kfs obj/tests
+INITRAMFS_PATHS = kern/kfs
+FIRST_INITRAMFS_PATH = $(firstword $(INITRAMFS_PATHS))
# Then grab the users Makelocal file to let them override Make system variables
# and set up other Make targets
endif
# Default programs for compilation
-USER_CFLAGS += -O2
+USER_CFLAGS += -O2 -std=gnu99
ifeq ($(COMPILER),IVY)
KERN_CFLAGS += --deputy \
--no-rc-sharc \
# List of directories that the */Makefrag makefile fragments will add to
OBJDIRS :=
-# List of directories that the */Makefrag makefile fragments will add to
-ROS_USER_LIBS :=
-
ROS_ARCH_DIR ?= $(TARGET_ARCH)
arch:
symlinks: error
ln -fs ../arch/$(ROS_ARCH_DIR) kern/include/arch
ln -fs arch/$(ROS_ARCH_DIR)/boot kern/boot
- ln -fs $(ROS_ARCH_DIR) user/include/arch
+ ln -fs $(ROS_ARCH_DIR) user/parlib/include/arch
@$(MAKE) -j $(MAKE_JOBS) all
# Include Makefrags for subdirectories
ifneq ($(TARGET_ARCH),)
-include user/Makefrag
include tests/Makefrag
include kern/Makefrag
endif
ifeq ($(GCCPREFIX),$(TARGET_ARCH)-ros-)
GCC_ROOT := $(shell which $(GCCPREFIX)gcc | xargs dirname)/../
tests/: tests
-tests:
+tests: install-libs
@$(MAKE) -j $(MAKE_JOBS) realtests
realtests: $(TESTS_EXECS)
- @mkdir -p fs/$(TARGET_ARCH)/tests
- cp -R $(OBJDIR)/$(TESTS_DIR)/* $(TOP_DIR)/fs/$(TARGET_ARCH)/tests
+# No longer automatically copying to the FS dir (deprecated)
+# @mkdir -p fs/$(TARGET_ARCH)/tests
+# cp -R $(OBJDIR)/$(TESTS_DIR)/* $(TOP_DIR)/fs/$(TARGET_ARCH)/tests
+
+USER_LIBS = parlib pthread c3po
+install-libs:
+ @for i in $(USER_LIBS) ; do \
+ cd user/$$i; \
+ $(MAKE); \
+ $(MAKE) install; \
+ cd ../..; \
+ done
+
+fill-kfs: install-libs
+ @rm -rf $(FIRST_INITRAMFS_PATH)/lib
+ @cp -R $(GCC_ROOT)/$(TARGET_ARCH)-ros/lib $(FIRST_INITRAMFS_PATH)
-install-libs: $(ROS_USER_LIBS)
- cp $(ROS_USER_LIBS) $(GCC_ROOT)/$(TARGET_ARCH)-ros/lib
- cp $(ROS_USER_LIBS) $(TOP_DIR)/fs/$(TARGET_ARCH)/lib
- cp -R $(USER_DIR)/include/* $(GCC_ROOT)/$(TARGET_ARCH)-ros/include
+userclean:
+ @for i in $(USER_LIBS) ; do \
+ cd user/$$i; \
+ $(MAKE) clean; \
+ cd ../..; \
+ done
+ @rm -rf $(OBJDIR)/$(TESTS_DIR)
.PHONY: tests
endif
doxyclean:
rm -rf $(DOXYGEN_DIR)/rosdoc
-# For deleting the build
-userclean:
- @rm -rf $(OBJDIR)/user
-
clean:
@rm -rf $(OBJDIR)
@echo All clean and pretty!
realclean: clean
@rm -f kern/boot
@rm -f kern/include/arch
- @rm -f user/include/arch
+ @rm -f user/parlib/include/arch
always:
@: