Open-source project
opnsense/core avatar
opnsense/core

OPNsense's Makefile Is BSD Make Split Into Seven Files, and Three Variables Are Mandatory

OPNsense GUI, API and systems backend

4,802 stars1,028 forksPHPBSD-2-Clause

At a glance

What is it?
The GUI, API and systems backend of a firewall distribution, built by a make implementation whose targets live in included fragments rather than in the Makefile, where an unset ABI, PHP or Python version produces a warning at parse time.
Who is it for?
This repository fits a developer who wants to work on the interface and system management layer of an open source firewall under a permissive licence, and who has a FreeBSD-flavoured build environment or a virtual machine to iterate in, since the build assumes package tooling and the documented loop involves a running instance.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly PHP, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • opnsense/core4,802 ★ · +108
Star history
Repository2026-09-232026-11-15
opnsense/core4.7k4.8k

108 Stars in the last 53 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The documented targets live in files the Makefile includes

The Makefile in this repository leans heavily on included fragments. Its default target pipes the README into your pager, and then it includes a set of fragments:

makefile
.include "Mk/version.mk"
.include "Mk/defaults.mk"
.include "Mk/common.mk"
.include "Mk/git.mk"
.include "Mk/lint.mk"
.include "Mk/style.mk"
.include "Mk/sweep.mk"

The README documents targets such as package, update, upgrade, collect, lint, style and sweep, and each of those fragments is named after a concern, so lint lives in one file and style checks in another. That has an immediate consequence for anyone reading the project. The documentation and the implementation of the build live in different files, so to find out what a target actually does you have to open the fragment rather than the Makefile. The syntax is BSD make throughout, with .include and .for directives, which also means the build will not run under GNU make as written. Nothing here is wrong, but it is a build system that assumes you already know the platform it targets.

ABI, PHP and Python are checked before any work happens

One loop in the Makefile is the first thing to understand before attempting a build. It iterates over the names ABI, PHP and PYTHON, and for each one it tests whether the corresponding variable is empty. If it is, the file emits a warning saying it cannot build without that value set, and in either case it appends the variable to CORE_MAKE. Two things follow. First, the failure mode is a parse-time warning rather than a link error or a missing header much later, which is the friendlier design. Second, the three values are not optional decoration. They are the version identities of the platform the package targets, and an unset or wrong value is the most likely reason a first build attempt goes nowhere. The README's own guidance is that options in general are either set to sane defaults or detected at run time, and the Makefile includes Mk/defaults.mk before this check, so confirm whether these three are already set before overriding them.

Packaging options are passed on the make command line

The package target builds a package of the current state of the repository, and the README says it may require several packages to be installed, with the target attempting to help when it fails, for example when a missing file needs to be fetched from an external location. What you can override is a list of options, and the names are specific enough to be worth writing down rather than paraphrasing. CORE_DEPENDS is the list of required dependencies for the package, and CORE_DEPENDS_ARCH is the list of packages required for a particular architecture. CORE_ORIGIN sets a FreeBSD compatible package or ports origin, CORE_COMMENT is a short description, CORE_MAINTAINER is the maintainer's email address, CORE_WWW is the package's web address, and CORE_NAME sets the package name. They are passed as make variables:

bash
# make package CORE_NAME=my_new_name

The presence of an origin option and an architecture-specific dependency list tells you the output is intended to fit the FreeBSD packaging system, so this is not a self-contained application build. It is a package build that expects to live inside that ecosystem.

make collect assumes you have a running system to collect from

Four of the targets describe a working method rather than a build, and they are the ones worth understanding before you write any code. Update pulls the latest commits from the current branch of the upstream repository. Upgrade runs the package build and replaces the currently installed package in the system. Collect fetches changes from the running system for all known files. Lint runs several syntax checks and is recommended before issuing a pull request. Together they describe a loop in which a real installation is the counterpart to your checkout, and collect in particular is the reverse direction of everything else: instead of pushing your files onto a system, you pull the system's files back into the tree. For that to be practical you need somewhere to run the firewall, and the README says as much, recommending an OPNsense virtual machine with the os-debug plugin installed for easier development, since that plugin is what offers the necessary tools.

Two style standards, because there is PHP and there is Python

The style target runs the PSR12 checks on MVC PHP code and the PEP8 checks on Python, respectively. That single sentence tells you more about the codebase than any directory listing. The repository's primary language is PHP, and the MVC in that description is the web interface layer, so the PHP code is expected to follow a published standard rather than a house one, which makes it readable to anyone who has worked in PHP. The existence of Python inside the same tree is less obvious, and holding it to PEP8 rather than inventing a rule means the scripts and tooling here are legible to Python developers without a guide. The sweep target runs several automatic sanitizers over the code base, and lint runs several syntax checks, so the quality gates are split into three commands with three different jobs. Nothing in the README says which of them continuous integration runs for you, so check that before assuming a green pull request status means all three passed.

The stated plan is gradual migration, not a rewrite

The stated aim of the project is worth quoting carefully, because it explains why the repository looks transitional. It aims to gradually evolve to a new codebase instead of using a big bang approach into something new, and the main outline of that new codebase is published in the architecture document linked from the README. Read that as a constraint on how the project changes rather than as a roadmap item. Nothing is being replaced wholesale, so you will find both the older patterns and the newer ones in the same tree, and a contributor reading the architecture document should expect to match surrounding code rather than impose the new structure everywhere. It also means architectural decisions are documented outside this repository, which is the second place to look after the build notes if you want to understand why a file lives where it does.

Every contribution must carry the same two-clause licence

The licence section is short and has a condition attached to contributing rather than only to using. OPNsense is and will always be available under the 2-Clause BSD licence, and every contribution made to the project must be licensed under the same conditions in order to keep OPNsense free and accessible for everybody. For an individual or a small team this is unremarkable. For an organisation whose standard contributor licence agreement is incompatible, it is a hard stop, and the requirement is stated as a condition of the contribution rather than as a preference. It is also worth noticing that the licence is the two-clause form rather than three, which is more permissive than the three-clause form and requires only that the copyright notice and disclaimer travel with redistributions. The repository root carries a security policy, a contribution guide, a plist and a ruleset file, so the governance scaffolding around the code is present as well.

Editorial conclusion

This repository fits a developer who wants to work on the interface and system management layer of an open source firewall under a permissive licence, and who has a FreeBSD-flavoured build environment or a virtual machine to iterate in, since the build assumes package tooling and the documented loop involves a running instance. It does not fit someone looking for a configuration to download, since this is the code rather than the image, and it does not fit a contributor whose employer requires a different licence, because every contribution must carry the same 2-clause BSD terms. Before you start, verify three things: the build notes in the separate tools repository, since this repository does not contain them, which of the two development styles the lint and style targets actually check, and whether you have the required ABI, PHP and Python versions set before you invoke a package build, since the makefile warns about them before doing any work.

Frequently asked questions

Is OPNsense a router or a firewall?

This repository does not settle that framing. It holds the GUI, API and systems backend of the OPNsense project, which invites developers to help create the best open source firewall available, and what the README describes is the build and contribution process for that interface and system management layer rather than the product's networking role.

Is OPNsense free for home use?

The project states that OPNsense is and will always be available under the 2-Clause BSD licence, and that every contribution must be licensed under the same conditions in order to keep it free and accessible for everybody. This repository contains the GUI, API and systems backend under that licence. The README says nothing about paid editions or feature gating.

Which firewall is better in 2026, OPNsense or pfSense?

The repository publishes no comparison with pfSense or with any other firewall, and no verdict on the question. What it does state about itself is the goal of creating the best open source firewall available, plus an approach of gradually evolving to a new codebase rather than a big bang rewrite, with the architecture outline published separately.

Is OPNsense as good as pfSense?

No such judgement appears here. The verifiable content concerns development rather than product comparison: build notes live in a separate tools repository, the Makefile is BSD make that includes seven fragments, and it offers package, update, upgrade, collect, lint, style and sweep targets, with a warning if the ABI, PHP or Python value is unset.

Official sources

  1. Issues
  2. License: BSD-2-Clause
  3. opnsense/core on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/opnsense-core.svg)](https://hysenlabs.com/projects/opnsense-core)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/opnsense-core.svg)](https://hysenlabs.com/projects/opnsense-core)

Was this useful?