2015-04-07 17:08:28 -04:00
|
|
|
CXX = $(shell wx-config --cxx)
|
|
|
|
|
|
|
|
SOURCES = $(wildcard src/network/*.cpp include/**/*.cpp include/*.cpp)
|
2015-03-31 16:43:42 -04:00
|
|
|
OBJECTS = $(patsubst %.cpp,%.o, $(SOURCES))
|
2015-04-07 17:08:28 -04:00
|
|
|
TARGET = build/Tyro.a
|
|
|
|
|
|
|
|
PROGRAM_SRC = $(wildcard src/*.cpp src/widgets/*.cpp)
|
|
|
|
PROGRAM = build/Tyro
|
|
|
|
PROGRAM_OBJECTS = $(patsubst %.cpp,%.o, $(PROGRAM_SRC))
|
|
|
|
|
2015-04-10 15:11:15 -04:00
|
|
|
BASE_FLAGS = -DSCI_LEXER -std=c++11
|
2015-04-07 17:08:28 -04:00
|
|
|
|
2015-04-09 22:07:59 -04:00
|
|
|
LDLIBS = $(TARGET) $(shell wx-config --libs base core aui stc adv) -lssh2
|
2015-04-09 17:16:28 -04:00
|
|
|
WX_CXXFLAGS = $(shell wx-config --cxxflags) $(BASE_FLAGS)
|
|
|
|
DEV_CXXFLAGS = -g -Wall -Wextra
|
|
|
|
CXXFLAGS = -Os
|
2015-04-07 17:08:28 -04:00
|
|
|
TEST_SRC= $(wildcard tests/*.cpp)
|
|
|
|
TESTS = $(patsubst %.cpp,%,$(TEST_SRC))
|
2015-03-31 16:43:42 -04:00
|
|
|
|
2015-04-07 17:08:28 -04:00
|
|
|
all: build $(TARGET) $(PROGRAM)
|
2015-03-31 16:43:42 -04:00
|
|
|
|
|
|
|
dev: CXXFLAGS= $(DEV_CXXFLAGS)
|
|
|
|
dev: all
|
|
|
|
|
|
|
|
build:
|
|
|
|
@mkdir -p build
|
|
|
|
|
2015-04-07 17:08:28 -04:00
|
|
|
$(TARGET): CXXFLAGS += -fPIC
|
2015-03-31 16:43:42 -04:00
|
|
|
$(TARGET): $(OBJECTS)
|
2015-04-07 17:08:28 -04:00
|
|
|
ar rcs $@ $(OBJECTS)
|
|
|
|
ranlib $@
|
|
|
|
|
|
|
|
|
|
|
|
$(PROGRAM): CXXFLAGS += $(WX_CXXFLAGS) $(TARGET)
|
2015-04-07 20:19:05 -04:00
|
|
|
$(PROGRAM):
|
|
|
|
$(CXX) $(WX_CXXFLAGS) $(PROGRAM_SRC) $(LDLIBS) -o $(PROGRAM)
|
2015-04-07 17:08:28 -04:00
|
|
|
|
2015-03-31 16:43:42 -04:00
|
|
|
|
|
|
|
run:
|
|
|
|
./build/Tyro
|
|
|
|
|
2015-04-07 10:59:08 -04:00
|
|
|
Tyro.app: all resources/platform/osx/Info.plist
|
2015-03-31 16:43:42 -04:00
|
|
|
SetFile -t APPL $(TARGET)
|
|
|
|
-mkdir Tyro.app
|
|
|
|
-mkdir Tyro.app/Contents
|
|
|
|
-mkdir Tyro.app/Contents/MacOS
|
|
|
|
-mkdir Tyro.app/Contents/Resources
|
|
|
|
-mkdir Tyro.app/Contents/Resources/English.lproj
|
2015-04-07 10:59:08 -04:00
|
|
|
cp resources/platform/osx/Info.plist Tyro.app/Contents/
|
2015-03-31 16:43:42 -04:00
|
|
|
echo -n 'APPL????' > Tyro.app/Contents/PkgInfo
|
|
|
|
cp build/Tyro Tyro.app/Contents/MacOS/Tyro
|
2015-04-07 10:59:08 -04:00
|
|
|
cp resources/platform/osx/tyro.icns Tyro.app/Contents/Resources/
|
2015-03-31 16:43:42 -04:00
|
|
|
|
2015-04-07 17:08:28 -04:00
|
|
|
.PHONY: tests
|
|
|
|
tests: LDLIBS = $(TARGET) -lssh2
|
|
|
|
tests: $(TESTS)
|
|
|
|
sh ./tests/runtests.sh
|
|
|
|
|
2015-03-31 16:43:42 -04:00
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
rm -rf Tyro.app
|
2015-04-07 17:08:28 -04:00
|
|
|
rm -rf build $(OBJECTS) $(PROGRAM) $(TARGET) $(TESTS)
|
2015-03-31 16:43:42 -04:00
|
|
|
find . -name "*.gc*" -exec rm {} \;
|
|
|
|
rm -rf `find . -name "*.dSYM" -print`
|