2019-04-29 08:22:36 +00:00
|
|
|
override CXXFLAGS := $(CXXFLAGS) --std=c++14 -fPIC -DDART_SHARED_LIB=1 -I $(DART_SDK)/include \
|
|
|
|
-I .dart_tool
|
|
|
|
objects := lib/src/angel_wings.o lib/src/wings_socket.o \
|
|
|
|
lib/src/bind.o lib/src/util.o lib/src/http.o \
|
|
|
|
.dart_tool/http-parser/http_parser.o
|
2019-04-27 19:12:09 +00:00
|
|
|
|
|
|
|
.PHONY: distclean clean
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -rf .dart_tool/http-parser
|
|
|
|
|
|
|
|
clean:
|
|
|
|
find . -type f -name '*.o' -delete
|
|
|
|
find . -type f -name '*.obj' -delete
|
|
|
|
find . -type f -name '*.so' -delete
|
|
|
|
find . -type f -name '*.dylib' -delete
|
2019-05-01 01:33:46 +00:00
|
|
|
find . -type f -name '*.dill' -delete
|
|
|
|
|
|
|
|
%-run: % example/main.dart
|
|
|
|
dart example/main.dill
|
|
|
|
|
|
|
|
example/main.dill: ./**/*.dart
|
|
|
|
dart --snapshot="$@" example/main.dart
|
2019-04-27 19:12:09 +00:00
|
|
|
|
2019-04-29 05:10:27 +00:00
|
|
|
mac: libangel_wings.dylib
|
2019-04-27 19:12:09 +00:00
|
|
|
|
|
|
|
linux: lib/src/libangel_wings.so
|
|
|
|
|
2019-04-29 05:10:27 +00:00
|
|
|
libangel_wings.dylib: lib/src/libangel_wings.dylib
|
|
|
|
cp $< $@
|
|
|
|
|
2019-04-27 19:12:09 +00:00
|
|
|
lib/src/libangel_wings.dylib: $(objects)
|
|
|
|
|
|
|
|
%.dylib: $(objects)
|
2019-04-30 17:40:11 +00:00
|
|
|
$(CXX) -shared -Wl,-undefined -Wl,dynamic_lookup -o $@ $^
|
2019-04-27 19:12:09 +00:00
|
|
|
|
|
|
|
%.so: $(objects)
|
|
|
|
$(CXX) -shared -o $@ $^
|
|
|
|
|
|
|
|
%.o: %.cc lib/src/angel_wings.h
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.cc lib/src/angel_wings.h %.h
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|