sample-package: create

This commit is contained in:
Ciro Santilli
2018-04-08 12:49:12 +01:00
parent c5f4d2289e
commit 105c506ac6
8 changed files with 77 additions and 11 deletions

4
sample_package/Config.in Normal file
View File

@@ -0,0 +1,4 @@
config BR2_PACKAGE_SAMPLE_PACKAGE
bool "sample_package"
help
Sample Buildroot package.

16
sample_package/Makefile Normal file
View File

@@ -0,0 +1,16 @@
.PHONY: all clean
CFLAGS_EXTRA ?= -ggdb3 -fopenmp -O0 -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)'

View File

@@ -0,0 +1 @@
name: SAMPLE_PACKAGE

View File

@@ -0,0 +1,21 @@
################################################################################
#
# 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.
$(MAKE) -C '$(@D)' CC="$(TARGET_CC)" LD="$(TARGET_LD)"
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))

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("hello sample_package");
return EXIT_SUCCESS;
}