Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ cc := g++
src := ./src
obj := ./obj

INCLUDE_DIRS ?=
LIBRARY_DIRS ?=

source := $(wildcard ${src}/*.cpp)
objfile := $(patsubst %.cpp,${obj}/%.o,$(notdir ${source}))
all=SOAPnuke
exe=SOAPnuke

CXXFLAGS := -std=c++11 -g -O3 $(foreach includedir,$(INCLUDE_DIRS),-I$(includedir)) $(CXXFLAGS)
LIBS := -lz -lpthread -lhts
LD_FLAGS := $(foreach librarydir,$(LIBRARY_DIRS),-L$(librarydir)) $(LIBS) $(LD_FLAGS)

MIN_GCC_VERSION = "4.7"
GCC_VERSION := $(shell gcc -dumpversion)
IS_GCC_ABOVE_MIN_VERSION := $(shell expr "$(GCC_VERSION)" ">=" "$(MIN_GCC_VERSION)")
Expand All @@ -23,17 +35,13 @@ else
endif
$(info $(ZLIB_VERSION_STRING))

source := $(wildcard ${src}/*.cpp)
objfile := $(patsubst %.cpp,${obj}/%.o,$(notdir ${source}))
all=SOAPnuke
exe=SOAPnuke


$(exe):${objfile}
$(cc) $(objfile) -o $@ -lz -lpthread -lhts -o $@
$(cc) $(objfile) -o $@ $(LD_FLAGS)

${obj}/%.o:${src}/%.cpp mk_dir
$(cc) -std=c++11 -g -O3 -c $< -o $@
$(cc) -c $< -o $@ $(CXXFLAGS)

mk_dir:
@if test ! -d $(obj) ; \
then \
Expand Down