mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 11:11:35 +01:00
lkmc_many_files: create package to test a rootfs with many files
Automatically pick up packages from under packages/ into BR2_EXTERNAL. Move many subdirectory READMEs into the toplevel and link to toplevel from those subreadmes instead.
This commit is contained in:
4
packages/sample_package/Config.in
Normal file
4
packages/sample_package/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
config BR2_PACKAGE_SAMPLE_PACKAGE
|
||||
bool "sample_package"
|
||||
help
|
||||
Sample Buildroot package.
|
||||
16
packages/sample_package/Makefile
Normal file
16
packages/sample_package/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
.PHONY: all clean
|
||||
|
||||
CFLAGS_EXTRA ?= -fopenmp -std=c99 -Wall -Werror -Wextra
|
||||
IN_EXT ?= .c
|
||||
LIBS :=
|
||||
OUT_EXT ?= .out
|
||||
|
||||
OUTS := $(addsuffix $(OUT_EXT), $(basename $(wildcard *$(IN_EXT))))
|
||||
|
||||
all: $(OUTS)
|
||||
|
||||
%$(OUT_EXT): %$(IN_EXT)
|
||||
$(CC) $(CFLAGS) $(CFLAGS_EXTRA) -o '$@' '$<' $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f *'$(OUT_EXT)'
|
||||
1
packages/sample_package/external.desc
Normal file
1
packages/sample_package/external.desc
Normal file
@@ -0,0 +1 @@
|
||||
name: SAMPLE_PACKAGE
|
||||
22
packages/sample_package/external.mk
Normal file
22
packages/sample_package/external.mk
Normal file
@@ -0,0 +1,22 @@
|
||||
################################################################################
|
||||
#
|
||||
# sample_package
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SAMPLE_PACKAGE_VERSION = 1.0
|
||||
SAMPLE_PACKAGE_SITE = $(BR2_EXTERNAL_SAMPLE_PACKAGE_PATH)
|
||||
SAMPLE_PACKAGE_SITE_METHOD = local
|
||||
|
||||
define SAMPLE_PACKAGE_BUILD_CMDS
|
||||
# D contains the source code of this package.
|
||||
# TARGET_CONFIGURE_OPTS contains several common options such as CFLAGS and LDFLAGS.
|
||||
$(MAKE) -C '$(@D)' $(TARGET_CONFIGURE_OPTS)
|
||||
endef
|
||||
|
||||
define SAMPLE_PACKAGE_INSTALL_TARGET_CMDS
|
||||
# Anything put inside TARGET_DIR will end up on the guest relative to the root directory.
|
||||
$(INSTALL) -D -m 0755 $(@D)/*.out '$(TARGET_DIR)'
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
7
packages/sample_package/sample_package.c
Normal file
7
packages/sample_package/sample_package.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
puts("hello sample_package");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user