Correct typo
[rpi-open-firmware.git] / Makefile
index e0d284a..cc6e4ef 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,12 +10,13 @@ SRCS = \
        romstage.c \
        sdram.c \
        arm_loader.c \
-       arm_monitor.c \
+       arm_monitor.cc \
        trap.c \
        lib/xprintf.c \
        lib/panic.c \
        lib/udelay.c \
        lib/memcpy.c \
+       lib/cxx_runtime.c \
        chainloader_inc.s
 
 ARCH = vc4
@@ -35,13 +36,17 @@ default: $(TARGET_BOOTCODE)
 
 OBJ := $(addprefix $(TARGET_BUILD_DIR)/, $(addsuffix .o, $(basename $(SRCS))))
 
-CROSS_COMPILE = /Developer/vc4-toolchain/prefix/bin/vc4-elf-
+# the cross compiler should already be in your path
+CROSS_COMPILE = vc4-elf-
 CC = $(CROSS_COMPILE)gcc
+CXX = $(CROSS_COMPILE)g++
 AS = $(CC)
 OBJCOPY = $(CROSS_COMPILE)objcopy
-LINKFLAGS = -nostdlib -nostartfiles
-CFLAGS = -c -nostdlib -std=c11 -fsingle-precision-constant -Wdouble-promotion -D__VIDEOCORE4__ -I./vc4_include/
-ASFLAGS = -c -nostdlib -x assembler-with-cpp -D__VIDEOCORE4__ -I./vc4_include/
+LINKFLAGS = -nostdlib -nostartfiles -Wl,--build-id=none -T linker.lds
+
+CFLAGS = -c -nostdlib -std=c11 -fsingle-precision-constant -Wdouble-promotion -D__VIDEOCORE4__ -I./vc4_include/ -I./
+ASFLAGS = -c -nostdlib -x assembler-with-cpp -D__VIDEOCORE4__ -I./vc4_include/ -I./
+CXXFLAGS = -c -nostdlib -std=c++11 -fno-exceptions -fno-rtti -D__VIDEOCORE4__ -I./vc4_include/ -I./
 
 HEADERS := \
        $(shell find . -type f -name '*.h') \
@@ -64,6 +69,11 @@ $(TARGET_BUILD_DIR)/%.o: %.c $(HEADERS)
        @echo $(WARN_COLOR)CC  $(NO_COLOR) $@
        @$(CC) $(CFLAGS) $< -o $@
 
+$(TARGET_BUILD_DIR)/%.o: %.cc $(HEADERS)
+       $(CREATE_SUBDIR)
+       @echo $(WARN_COLOR)CXX $(NO_COLOR) $@
+       @$(CXX) $(CXXFLAGS) $< -o $@
+
 $(TARGET_BUILD_DIR)/%.o: %.s $(HEADERS)
        $(CREATE_SUBDIR)
        @echo $(WARN_COLOR)AS  $(NO_COLOR) $@
@@ -79,4 +89,4 @@ $(TARGET_BOOTCODE): create_build_directory $(OBJ)
 
 clean:
        @echo $(ERROR_COLOR)CLEAN$(NO_COLOR)
-       @-rm -rf ./$(BUILD_DIR)
\ No newline at end of file
+       @-rm -rf ./$(BUILD_DIR)
This page took 0.023681 seconds and 4 git commands to generate.