Skip to content

Commit

Permalink
[jsonbuilder] - do it properly ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Memphiz committed Jun 3, 2014
1 parent b5e06ca commit e7e4c7b
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 29 deletions.
10 changes: 7 additions & 3 deletions codegenerator.mk
Expand Up @@ -22,7 +22,7 @@ GENERATED_JSON = $(INTERFACES_DIR)/json-rpc/ServiceDescription.h addons/xbmc.jso
ifeq ($(wildcard $(JSON_BUILDER)),)
JSON_BUILDER = $(shell which JsonSchemaBuilder)
ifeq ($(JSON_BUILDER),)
JSON_BUILDER = tools/depends/native/JsonSchemaBuilder/JsonSchemaBuilder
JSON_BUILDER = tools/depends/native/JsonSchemaBuilder/bin/JsonSchemaBuilder
endif
endif

Expand Down Expand Up @@ -75,7 +75,11 @@ $(GENERATED_JSON): $(JSON_BUILDER)
@echo Jsonbuilder: $(JSON_BUILDER)
make -C $(INTERFACES_DIR)/json-rpc $(notdir $@)

ifneq ($(CROSS_COMPILING), yes)
$(JSON_BUILDER):
make -C $(dir $@)
ifeq ($(BOOTSTRAP_FROM_DEPENDS), yes)
@echo JsonSchemaBuilder not found. You didn\'t build depends. Check docs/README.\<yourplatform\>
@false
else
#build json builder - ".." because makefile is in the parent dir of "bin"
make -C $(abspath $(dir $@)..)
endif
36 changes: 27 additions & 9 deletions tools/depends/native/JsonSchemaBuilder/Makefile
@@ -1,9 +1,10 @@
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-include ../../Makefile.include

ifeq ($(NATIVEPREFIX),)
PREFIX = .
PREFIX = $(ROOT_DIR)
else
PREFIX = $(NATIVEPREFIX)/bin
PREFIX = $(NATIVEPREFIX)
endif

ifeq ($(NATIVEPLATFORM),)
Expand All @@ -12,15 +13,32 @@ else
PLATFORM = $(NATIVEPLATFORM)
endif

SOURCE=$(ROOT_DIR)/src

CONFIGURE=./configure --prefix=$(PREFIX)
APP=$(SOURCE)/JsonSchemaBuilder
APPBIN=$(PREFIX)/bin/JsonSchemaBuilder

all: .installed-$(PLATFORM)

$(PREFIX)/JsonSchemaBuilder:
make -C src
cp src/JsonSchemaBuilder $(PREFIX)
$(PLATFORM):
-rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM)
cd $(PLATFORM); cp -a $(SOURCE)/* .
cd $(PLATFORM); ./autogen.sh
cd $(PLATFORM); $(CONFIGURE)

clean:
make -C src clean
@rm -f JsonSchemaBuilder .installed-$(PLATFORM)

.installed-$(PLATFORM): $(PREFIX)/JsonSchemaBuilder
$(APP): $(PLATFORM)
$(MAKE) -C $(PLATFORM)


.installed-$(PLATFORM): $(APP)
$(MAKE) -C $(PLATFORM) install
touch $@

clean:
$(MAKE) -C $(PLATFORM) clean

distclean::
rm -rf $(PLATFORM) .installed-$(PLATFORM)
-rm -rf bin
15 changes: 0 additions & 15 deletions tools/depends/native/JsonSchemaBuilder/src/Makefile

This file was deleted.

3 changes: 3 additions & 0 deletions tools/depends/native/JsonSchemaBuilder/src/Makefile.am
@@ -0,0 +1,3 @@
bin_PROGRAMS = JsonSchemaBuilder
JsonSchemaBuilder_SOURCES = JsonSchemaBuilder.cpp

3 changes: 3 additions & 0 deletions tools/depends/native/JsonSchemaBuilder/src/autogen.sh
@@ -0,0 +1,3 @@
#!/bin/sh

autoreconf -vif
10 changes: 10 additions & 0 deletions tools/depends/native/JsonSchemaBuilder/src/configure.ac
@@ -0,0 +1,10 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(JsonSchemaBuilder, 1.0, me@mail.com)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(JsonSchemaBuilder.cpp)

AM_INIT_AUTOMAKE([foreign])

AC_PROG_CXX

AC_OUTPUT(Makefile)
2 changes: 1 addition & 1 deletion tools/depends/target/xbmc/Makefile
Expand Up @@ -19,7 +19,7 @@ all: $(SOURCE)/libxbmc.so


$(SOURCE)/libxbmc.so:
cd $(SOURCE); ./bootstrap
cd $(SOURCE); BOOTSTRAP_FROM_DEPENDS=yes ./bootstrap
cd $(SOURCE); $(CONFIGURE)

../../Makefile.include:
Expand Down
2 changes: 1 addition & 1 deletion xbmc/interfaces/json-rpc/Makefile
Expand Up @@ -31,7 +31,7 @@ all: $(GENERATED_JSON) $(GENERATED_ADDON_JSON) $(LIB)
ifeq ($(wildcard $(JSON_BUILDER)),)
JSON_BUILDER = $(shell which JsonSchemaBuilder)
ifeq ($(JSON_BUILDER),)
JSON_BUILDER = ../../../tools/depends/native/JsonSchemaBuilder/JsonSchemaBuilder
JSON_BUILDER = ../../../tools/depends/native/JsonSchemaBuilder/bin/JsonSchemaBuilder
endif
endif

Expand Down

0 comments on commit e7e4c7b

Please sign in to comment.