|
@@ -16,19 +16,24 @@
|
|
|
|
|
|
PLATFORM := $(shell uname | sed -e 's/_.*//')
|
|
PLATFORM := $(shell uname | sed -e 's/_.*//')
|
|
|
|
|
|
|
|
+ifeq ($(LIBTOOL),rlibtool)
|
|
|
|
+ TGTLIBTOOL:=slibtool-shared
|
|
|
|
+endif
|
|
|
|
+
|
|
ifndef LIBTOOL
|
|
ifndef LIBTOOL
|
|
ifeq ($(PLATFORM), Darwin)
|
|
ifeq ($(PLATFORM), Darwin)
|
|
LIBTOOL:=glibtool
|
|
LIBTOOL:=glibtool
|
|
else
|
|
else
|
|
LIBTOOL:=libtool
|
|
LIBTOOL:=libtool
|
|
endif
|
|
endif
|
|
|
|
+ TGTLIBTOOL=$(LIBTOOL)
|
|
endif
|
|
endif
|
|
ifeq ($(PLATFORM), CYGWIN)
|
|
ifeq ($(PLATFORM), CYGWIN)
|
|
NO_UNDEFINED:=-no-undefined
|
|
NO_UNDEFINED:=-no-undefined
|
|
endif
|
|
endif
|
|
-LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC)
|
|
|
|
-INSTALL_CMD = $(LIBTOOL) --mode=install install
|
|
|
|
-UNINSTALL_CMD = $(LIBTOOL) --mode=uninstall rm
|
|
|
|
|
|
+LTCOMPILE = $(TGTLIBTOOL) --mode=compile --tag=CC $(CC)
|
|
|
|
+INSTALL_CMD = $(TGTLIBTOOL) --mode=install install
|
|
|
|
+UNINSTALL_CMD = $(TGTLIBTOOL) --mode=uninstall rm
|
|
|
|
|
|
#Output filenames for various targets.
|
|
#Output filenames for various targets.
|
|
ifndef LIBNAME
|
|
ifndef LIBNAME
|
|
@@ -49,15 +54,15 @@ src/ciphers/aes/aes_enc.o: src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c
|
|
LOBJECTS = $(OBJECTS:.o=.lo)
|
|
LOBJECTS = $(OBJECTS:.o=.lo)
|
|
|
|
|
|
$(LIBNAME): $(OBJECTS)
|
|
$(LIBNAME): $(OBJECTS)
|
|
- $(LIBTOOL) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED)
|
|
|
|
|
|
+ $(TGTLIBTOOL) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) $(LOBJECTS) $(EXTRALIBS) -o $@ -rpath $(LIBPATH) -version-info $(VERSION_LT) $(NO_UNDEFINED)
|
|
|
|
|
|
test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS)
|
|
test: $(call print-help,test,Builds the library and the 'test' application to run all self-tests) $(LIBNAME) $(TOBJECTS)
|
|
- $(LIBTOOL) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
|
|
|
|
|
|
+ $(TGTLIBTOOL) --mode=link --tag=CC $(CC) $(LTC_LDFLAGS) -o $(TEST) $(TOBJECTS) $(LIBNAME) $(EXTRALIBS)
|
|
|
|
|
|
# build the demos from a template
|
|
# build the demos from a template
|
|
define DEMO_template
|
|
define DEMO_template
|
|
$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME)
|
|
$(1): $(call print-help,$(1),Builds the library and the '$(1)' demo) demos/$(1).o $$(LIBNAME)
|
|
- $$(LIBTOOL) --mode=link --tag=CC $$(CC) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1)
|
|
|
|
|
|
+ $$(TGTLIBTOOL) --mode=link --tag=CC $$(CC) $$(LTC_LDFLAGS) $$^ $$(EXTRALIBS) -o $(1)
|
|
endef
|
|
endef
|
|
|
|
|
|
$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
|
|
$(foreach demo, $(strip $(DEMOS)), $(eval $(call DEMO_template,$(demo))))
|