old-DasOS/prototypes/common.mk

36 lines
842 B
Makefile
Raw Permalink Normal View History

2016-06-26 12:36:32 +00:00
##
# DasOS common Makefile targets
##
INCLUDE_DIRS += ../include/ /opt/lib/gcc/i686-elf/6.1.0/include/
FLAGS += -ffreestanding -mno-sse -Werror -Wall -iquote include $(addprefix -I, $(INCLUDE_DIRS)) -O3 -g
ASFLAGS += $(FLAGS)
CFLAGS += $(FLAGS)
CXXFLAGS += $(FLAGS) -std=c++14 -fno-rtti -fno-exceptions -fno-leading-underscore -fno-use-cxa-atexit -nostdlib -fno-builtin
LDFLAGS += -L../libs/
2016-06-26 12:36:32 +00:00
SRCS += $(shell find -regextype egrep -regex '.*/.*\.(cpp|S|c)')
OBJS += $(addsuffix .o, $(notdir $(basename $(SRCS))))
2016-06-26 12:36:32 +00:00
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c -o obj/$@ $<
%.o: %.c
$(CC) $(CFLAGS) -c -o obj/$@ $<
2016-06-26 12:36:32 +00:00
%.o: %.S
$(AS) $(ASFLAGS) -c -o obj/$@ $<
2016-06-26 12:36:32 +00:00
%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o obj/$@ $<
%.o: src/%.c
$(CC) $(CFLAGS) -c -o obj/$@ $<
2016-06-26 12:36:32 +00:00
%.o: src/%.S
$(AS) $(ASFLAGS) -c -o obj/$@ $<
2016-06-26 12:36:32 +00:00
builddir:
mkdir -p ./obj/