Merge branch 'oom' of github.com:capveg/OpenNetworkLinux into oom

This commit is contained in:
Rob Sherwood
2016-02-12 08:42:11 -08:00
7 changed files with 88 additions and 0 deletions

16
docs/dev.md Normal file
View 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.'"""

View File

@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk

View File

@@ -0,0 +1,2 @@
!include $ONL/packages/base/any/oom_shim/APKG.yml ARCH=amd64 TOOLCHAIN=x86_64-linux-gnu

View File

@@ -0,0 +1,3 @@
include $(ONL)/make/config.amd64.mk
include $(ONL)/packages/base/any/oom_shim/builds/Makefile

View 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

View 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)

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
int test_func(int argc)
{
printf("Looks like it works...\n");
}