diff options
Diffstat (limited to 'rules/osgi42-core/Makefile')
-rw-r--r-- | rules/osgi42-core/Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/rules/osgi42-core/Makefile b/rules/osgi42-core/Makefile new file mode 100644 index 0000000..30eb1f7 --- /dev/null +++ b/rules/osgi42-core/Makefile @@ -0,0 +1,35 @@ +DESTDIR ?= +MAVEN_LOCAL_REPO ?= ~/.m2 + +FAIL = exit 1 +FIND = find +INSTALL = install +JAR = jar +JAVAC = javac +MKDIRS = mkdir -p +RM = rm -f + +groupId = org.osgi +artifactId = org.osgi.core +version = 5.0.0 + +dep_dir = $1 $(shell $(FIND) $1 2>/dev/null) +mvndir = $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(groupId))/$(artifactId)/$(version) + +all: PHONY build/$(artifactId)-$(version).jar +install: PHONY $(mvndir)/$(artifactId)-$(version).jar + +build/classes: $(call dep_dir,src) + $(RM) -r $@ + $(MKDIRS) $@ + $(FIND) src -name '*.java' -exec $(JAVAC) -d $@ {} + || { $(RM) -r $@; $(FAIL); } +build/$(artifactId)-$(version).jar: $(call dep_dir,build/classes) + $(JAR) -cf $@ -C build/classes . +$(mvndir)/$(artifactId)-$(version).jar: build/$(artifactId)-$(version).jar + $(INSTALL) -Dm644 $< $@ + +clean: PHONY + $(RM) -r build + +.PHONY: PHONY +.DELETE_ON_ERROR: |