added support for FreeBSD. Closes #4.

This commit is contained in:
Gregory Pakosz
2016-02-11 13:30:39 +00:00
parent 8ad3792af0
commit 73c56ffacc
3 changed files with 121 additions and 1 deletions

View File

@ -24,6 +24,10 @@ ifeq ($(platform),)
override CC := gcc
endif
endif
ifeq ($(__uname_s),freebsd)
override platform := freebsd
override architecture := $(__uname_m)
endif
endif
ifeq ($(architecture),)
override architecture := unknown-architecture
@ -41,13 +45,17 @@ CFLAGS := -O2 -g -Wall -pedantic -Werror -std=c99
CXXFLAGS := -O2 -g -Wall -pedantic -Werror
ifeq ($(platform),linux)
override LDFLAGS := $(LDFLAGS) -ldl
LDFLAGS += -ldl
CFLAGS += -D_XOPEN_SOURCE=500 -fpic
CXXFLAGS += -fpic
endif
ifeq ($(platform),mac)
CFLAGS += -D_DARWIN_C_SOURCE
endif
ifeq ($(platform),freebsd)
CFLAGS += -fpic
CXXFLAGS += -fpic
endif
ifeq ($(platform),mac)
libsuffix := .dylib
@ -58,6 +66,9 @@ endif
ifeq ($(platform),windows)
libsuffix := .dll
endif
ifeq ($(platform),freebsd)
libsuffix := .so
endif
.PHONY: build-executable
build: build-executable