adding Makefile, tired of using Xcode

works_for_me
Volker Birk 3 years ago
parent 2e2c4915c9
commit d0dc0916e1

@ -0,0 +1,63 @@
-include local.conf
DOWNLOADCLIENT?=../../downloadclient
BOOST_INCLUDE?=/opt/local/include
BOOST_LIB?=/opt/local/lib
CRYPTOPP_INCLUDE?=/opt/local/include
CRYPTOPP_LIB?=/opt/local/lib
CC?=cc
CXX?=c++
CFLAGS+=-std=c17
CXXFLAGS+=-I$(BOOST_INCLUDE) -I$(CRYPTOPP_INCLUDE) -std=c++17
LDFLAGS+=-L$(BOOST_LIB) -lboost_regex-mt -L$(CRYPTOPP_LIB) -lcryptopp -lobjc -lssl -lcrypto -framework Foundation
LDFLAGS+=-L$(DOWNLOADCLIENT) -ldownloadclient
ifdef NDEBUG
CFLAGS+=-O3 -DNDEBUG
CXXFLAGS+=-O3 -DNDEBUG
else
CFLAGS+=-O0 -g
CXXFLAGS+=-O0 -g
endif
TARGET=foundation.pEp.adapter.macOS
ALL_SOURCE=$(wildcard *.m) $(wildcard *.mm)
DEPENDS=$(subst .m,.d,$(subst .mm,.d,$(ALL_SOURCE)))
ALL_OBJECTS=$(subst .d,.o,$(DEPENDS))
all: $(TARGET)
%.d: %.m
@set -e; rm -f $@; \
$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
%.d: %.mm
@set -e; rm -f $@; \
$(CC) -MM $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
# If only the goal 'clean' is given, do not generate and include the '%.d' files.
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPENDS)
endif
$(TARGET): $(ALL_OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^
ifdef NDEBUG
strip $@
endif
%.o: %.mm
$(CXX) $(CXXFLAGS) -c -o $@ $^
.PHONY: clean
clean:
rm -f *.o $(TARGET)

@ -46,10 +46,8 @@ int main(int argc, const char *argv[])
ServiceDelegate *delegate = [ServiceDelegate new];
// Set up the one NSXPCListener for this service. It will handle all incoming connections.
NSXPCListener *listener = [NSXPCListener serviceListener];
NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:@"foundation.pEp.adapter.macOS"];
listener.delegate = delegate;
// Resuming the serviceListener starts this service. This method does not return.
[listener resume];
return 0;
}

@ -14,10 +14,10 @@
@interface pEpUpdater : NSObject
/// default 2 hours = 7200 seconds
@property NSTimer* timer;
@property (strong) NSTimer* timer;
/// path with config files
@property NSString* configPath;
@property (strong) NSString* configPath;
/// initializes the pEpUpdater
///

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleDisplayName</key>
<string>p≡p update service</string>
<key>LSHasLocalizedDisplayName</key>
<true/>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSBackgroundOnly</key>
<true/>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020 p≡p foundation. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSSupportsAutomaticTermination</key>
<true/>
<key>NSSupportsSuddenTermination</key>
<true/>
<key>NSUserNotificationAlertStyle</key>
<string>alert</string>
</dict>
</plist>
Loading…
Cancel
Save