Files
linux-kernel-module-cheat/packages/kernel_modules/user/Makefile
Ciro Santilli 六四事件 法轮功 bc73cebff1 Build the Linux kernel independently from Buildroot
This will allow for other types of root filesystems that don't rely on Buildroot
to be added and used in the future.

Propagate --verbose on all build scripts to see full GCC commands.

build-all: allow for neat subsets

also 9p share rootfs_overlay. TODO document.
2018-10-12 09:30:33 +01:00

49 lines
1.3 KiB
Makefile

.PHONY: all clean mkdir
CFLAGS_EXTRA = -fopenmp -std=c99
CXXFLAGS_EXTRA = -std=c++17
CCFLAGS_EXTRA = -Wall -Werror -Wextra
IN_EXT_C = .c
IN_EXT_CXX = .cpp
LIBS = -lm
OUT_EXT = .out
OUT_DIR = .
OUTS := $(foreach IN_EXT,$(IN_EXT_C) $(IN_EXT_CXX),$(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT)))))
ifeq ($(BR2_PACKAGE_EIGEN),y)
CXXFLAGS_EXTRA += -I$(STAGING_DIR)/usr/include/eigen3
# TODO: was failing with:
# fatal error: Eigen/Dense: No such file or directory as of
# 975ce0723ee3fa1fea1766e6683e2f3acb8558d6
# http://lists.busybox.net/pipermail/buildroot/2018-June/222914.html
#CXXFLAGS_EXTRA += $(shell $(PKG_CONFIG) --cflags eigen3)
else
OUTS := $(filter-out eigen_%$(OUT_EXT),$(OUTS))
endif
ifeq ($(BR2_PACKAGE_LIBDRM),y)
LIBS += $(shell $(PKG_CONFIG) --libs libdrm)
CFLAGS_EXTRA += $(shell $(PKG_CONFIG) --cflags libdrm)
else
OUTS := $(filter-out libdrm_%$(OUT_EXT),$(OUTS))
endif
ifeq ($(BR2_PACKAGE_OPENBLAS),y)
LIBS += -lopenblas
else
OUTS := $(filter-out openblas$(OUT_EXT),$(OUTS))
endif
OUTS := $(addprefix $(OUT_DIR)/,$(OUTS))
all: mkdir $(OUTS)
$(OUT_DIR)/%$(OUT_EXT): %$(IN_EXT_C)
$(CC) $(CFLAGS) $(CFLAGS_EXTRA) -o '$@' '$<' $(LIBS)
$(OUT_DIR)/%$(OUT_EXT): %$(IN_EXT_CXX)
$(CXX) $(CXXFLAGS) $(CXXFLAGS_EXTRA) -o '$@' '$<' $(LIBS)
clean:
rm -f *'$(OUT_EXT)'
mkdir:
mkdir -p '$(OUT_DIR)'