Browse Source

IPS-100 Linking Experiments.

We can't really link statically yet, but we can build a .so of the
adapter, which means we know all the dependencies and we have the
required obj-c options.
IPS-100
Marcel Schneider 2 months ago
parent
commit
3c7bdfb726
5 changed files with 23 additions and 4 deletions
  1. +2
    -1
      .gitignore
  2. +10
    -2
      Makefile.common
  3. +8
    -0
      Makefile.conf
  4. +1
    -1
      Subprojects/PEPObjCTypes/PEPObjCTypes/build-linux/Makefile
  5. +2
    -0
      pEpObjCAdapter/build-linux/Makefile

+ 2
- 1
.gitignore View File

@ -1,4 +1,5 @@
##GNUstep
# pEp build config
local.conf
### Pre Compiled Headers
*.d


+ 10
- 2
Makefile.common View File

@ -1,5 +1,7 @@
# Makefile skeleton to build static libraries from objective C.
# Define $(TARGET) (library name), $(OBJECTS) (*.o files) and then include this.
# Define $(TARGET) (library name), $(OBJECTS) (*.o files), $(LIBS) (linker
# flags specific to this library), $(HEADERS) (header files to be installed)
# and then include this.
# This will respect local.conf automatically.
HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
@ -31,6 +33,12 @@ OBJCFLAGS = $(CFLAGS) \
-fobjc-runtime=gnustep-2.0 -fobjc-arc -fblocks -x objective-c \
-include PEPObjCGNUStepOptimizations.h
OBJCLINKFLAGS = $(LDFLAGS) \
-fuse-ld=/usr/bin/ld.gold \
-pthread -fexceptions -rdynamic -fblocks \
-fobjc-runtime=gnustep-2.0 \
# Unless any rule is defined before including this, this will be the default rule.
$(TARGET) : $(TARGET).a $(TARGET).so
@ -39,7 +47,7 @@ $(TARGET).a : $(OBJECTS)
ranlib $@
$(TARGET).so : $(OBJECTS)
clang --shared $(LD_FLAGS) -Wl,--no-undefined -o $@ $^ $(LD_LIBS)
clang --shared $(OBJCLINKFLAGS) -Wl,--no-undefined -o $@ $^ $(LD_LIBS) $(LIBS)
%.o: %.m $(GENERATED)


+ 8
- 0
Makefile.conf View File

@ -1,12 +1,20 @@
# Build default config
# Prefix to install things to, we also expect to find dependencies (incl. GNUstep) there.
PREFIX ?= $(HOME)/local/
CFLAGS ?= -fPIC -DPIC -g -Og
# pEp Engine header files (including pEp/ prefix)
PEP_INCLUDE = $(PREFIX)/include/pEp/
EXTRA_INCLUDES =
# these are only needed for building shared libs.
LD_LIBS = -L$(PREFIX)/lib/ -L$(PREFIX)/Library/Libraries -L$(PREFIX)/System/Library/Libraries \
-lgnustep-base -ldispatch -lpthread -lobjc -lm
# Overrides
-include $(HERE)/local.conf

+ 1
- 1
Subprojects/PEPObjCTypes/PEPObjCTypes/build-linux/Makefile View File

@ -1,5 +1,5 @@
OBJECTS := $(patsubst %.m,%.o,$(wildcard ../src/*.m))
OBJECTS := $(patsubst %.m,%.o,$(wildcard ../src/*.m ../src/*/*.m))
DEPFILES := $(wildcard ../src/*.d)
HEADERS := $(wildcard ../PublicHeaders/*.h)
TARGET = libPEPObjCTypes


+ 2
- 0
pEpObjCAdapter/build-linux/Makefile View File

@ -3,6 +3,8 @@ OBJECTS := $(patsubst %.m,%.o,$(wildcard ../*.m))
DEPFILES := $(wildcard ../*.d)
HEADERS := $(wildcard ../PublicHeaders/*.h)
TARGET = libpEpObjCAdapter
LIBS = -lpEpEngine -Wl,--whole-archive -lPEPObjCTypes -lPEPObjCTypeUtils -lPEPObjCAdapterProtocols -Wl,--no-whole-archive
include ../../Makefile.common
include $(DEPFILES)

Loading…
Cancel
Save