mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-27 02:04:43 +00:00
Merge branch 'oom' of github.com:capveg/OpenNetworkLinux into oom
This commit is contained in:
16
docs/dev.md
Normal file
16
docs/dev.md
Normal file
@@ -0,0 +1,16 @@
|
||||
==== FIXME ===
|
||||
Finish this doc
|
||||
|
||||
== Adding a new package
|
||||
|
||||
* Create most of the files in the 'any' architecture for cross compiling
|
||||
* Copy the directory structure from an existing package
|
||||
* APKG.yml goes into the $(ONL)/packages/base/any/foo/ directory
|
||||
* PKG.yml goes into the $(ONL)/packages/base/$ARCH/foo directory
|
||||
* Create for each $ARCH you intend to support
|
||||
* Put code in $(ONL)/packages/base/any/foo/src
|
||||
* Put package specific Makefiles in $(ONL)/packages/base/any/builds
|
||||
|
||||
* Run `make rebuild` in $(ONL)/packages/base/$ARCH/foo to rebuild the package cache
|
||||
* particularly if you see an error like:
|
||||
"""ERROR:onlpm:'Package all does not exist.'"""
|
||||
1
packages/base/amd64/oom_shim/Makefile
Normal file
1
packages/base/amd64/oom_shim/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
2
packages/base/amd64/oom_shim/PKG.yml
Normal file
2
packages/base/amd64/oom_shim/PKG.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
!include $ONL/packages/base/any/oom_shim/APKG.yml ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu
|
||||
|
||||
3
packages/base/amd64/oom_shim/builds/Makefile
Normal file
3
packages/base/amd64/oom_shim/builds/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
include $(ONL)/make/config.amd64.mk
|
||||
include $(ONL)/packages/base/any/oom_shim/builds/Makefile
|
||||
|
||||
32
packages/base/any/oom_shim/APKG.yml
Normal file
32
packages/base/any/oom_shim/APKG.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
############################################################
|
||||
#
|
||||
# OOM SHIM
|
||||
#
|
||||
# Requires: ARCH, TOOLCHAIN
|
||||
#
|
||||
############################################################
|
||||
variables:
|
||||
libdir: /lib/${TOOLCHAIN}
|
||||
|
||||
common:
|
||||
arch: $ARCH
|
||||
version: 1.0.0
|
||||
copyright: Copyright 2016 Big Switch Networks
|
||||
maintainer: support@bigswitch.com
|
||||
|
||||
|
||||
|
||||
packages:
|
||||
- name: oom_shim
|
||||
version: 1.0.0
|
||||
summary: Open Optical Module Wrapper library around ONLP
|
||||
provides: [ oom_shim ]
|
||||
|
||||
files:
|
||||
builds/$BUILD_DIR/${TOOLCHAIN}/liboom_shim.so : $libdir/
|
||||
|
||||
changelog: Initial code for 2016 OCP Demo
|
||||
|
||||
|
||||
|
||||
|
||||
27
packages/base/any/oom_shim/builds/Makefile
Normal file
27
packages/base/any/oom_shim/builds/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
include $(ONL)/make/any.mk
|
||||
|
||||
ifndef TOOLCHAIN
|
||||
$(error Must define $$TOOLCHAIN to use this Makefile)
|
||||
endif
|
||||
|
||||
ifndef RELEASE
|
||||
$(warn Assuming RELEASE is wheezy -- FIXME)
|
||||
RELEASE=wheezy
|
||||
endif
|
||||
|
||||
PACKAGE=oom_shim
|
||||
|
||||
OUTDIR=$(ONL)/packages/base/$(ARCH)/$(PACKAGE)/builds/BUILD/$(RELEASE)/$(TOOLCHAIN)
|
||||
|
||||
VPATH=$(ONL)/packages/base/any/$(PACKAGE)/src
|
||||
|
||||
$(OUTDIR)/liboom_shim.so: oom_shim.c
|
||||
@mkdir -p $(OUTDIR) || true
|
||||
@$(CC) -o $(OUTDIR)/liboom_shim.so -shared -fPIC $+
|
||||
|
||||
.PHONY: deb
|
||||
deb:
|
||||
$(MAKE) -C deb
|
||||
|
||||
clean:
|
||||
rm -rf $(OUTDIR)
|
||||
7
packages/base/any/oom_shim/src/oom_shim.c
Normal file
7
packages/base/any/oom_shim/src/oom_shim.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int test_func(int argc)
|
||||
{
|
||||
|
||||
printf("Looks like it works...\n");
|
||||
}
|
||||
Reference in New Issue
Block a user