Last active
August 29, 2015 14:24
-
-
Save nabijaczleweli/83737c02e71ea5ae6554 to your computer and use it in GitHub Desktop.
Indoctrinating @Nooble part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I normally put this in a separate file, but v0v | |
ifeq "$(OS)" "Windows_NT" | |
devnull := nul | |
DLL := .dll | |
MKDIR := busybox mkdir | |
PIC := | |
PREDLL = | |
FIND = busybox find | |
else | |
devnull := /dev/null | |
ifeq "$(OS)" "Darwin" | |
DLL := .dylib | |
else | |
DLL := .so | |
endif | |
MKDIR := mkdir | |
PIC := -fPIC | |
PREDLL = lib | |
FIND = find | |
endif | |
OBJ := .o | |
ARCH := .a | |
CXXAR := -Os -pedantic -pipe -fomit-frame-pointer -isystemlibyaml/include $(PIC) -std=c++14 -Isrc -fpermissive -Wno-pedantic | |
OUTDIR := out/ | |
OBJDIR := $(OUTDIR)obj/ | |
SRCDIR := src/ | |
SOURCES = $(sort $(shell $(FIND) $(SRCDIR)$(1) -name *.cpp)) | |
OBJECTS = $(sort $(shell $(FIND) $(OUTDIR) -name *$(OBJ))) | |
all : $(subst $(SRCDIR),$(OBJDIR),$(subst .cpp,$(OBJ),$(foreach mod,$(subst :, ,$(Bullet3BuildMakeModules)),$(call SOURCES,Bullet3$(mod))))) | |
@$(MKDIR) -p $(dir $@) || : | |
$(CXX) $(CXXAR) -shared -o$(OUTDIR)$(PREDLL)Bullet3$(DLL) $(subst $(SRCDIR),$(OBJDIR),$^) -L. -lopencl -Wl,--enable-stdcall-fixup | |
$(OBJDIR)%$(OBJ) : $(SRCDIR)%.cpp | |
@$(MKDIR) -p $(dir $@) || : | |
$(CXX) $(CXXAR) -c -o$@ $^ |
Needs a (possibly shell) variable Bullet3BuildMakeModules
to be set to ':
' separated module names
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note, that this assumes, that
opencl
can be found via-L.