1# ===========================================================================
2#
3#                            PUBLIC DOMAIN NOTICE
4#               National Center for Biotechnology Information
5#
6#  This software/database is a "United States Government Work" under the
7#  terms of the United States Copyright Act.  It was written as part of
8#  the author's official duties as a United States Government employee and
9#  thus cannot be copyrighted.  This software/database is freely available
10#  to the public for use. The National Library of Medicine and the U.S.
11#  Government have not placed any restriction on its use or reproduction.
12#
13#  Although all reasonable efforts have been taken to ensure the accuracy
14#  and reliability of the software and data, the NLM and the U.S.
15#  Government do not and cannot warrant the performance or results that
16#  may be obtained by using this software or data. The NLM and the U.S.
17#  Government disclaim all warranties, express or implied, including
18#  warranties of performance, merchantability or fitness for any particular
19#  purpose.
20#
21#  Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25default: std
26
27TOP ?= $(abspath ../..)
28MODULE = libs/ngs-jni
29
30INT_LIBS = \
31	libngs-jni
32
33EXT_LIBS = \
34
35ALL_LIBS = \
36	$(INT_LIBS) \
37	$(EXT_LIBS)
38
39include $(TOP)/build/Makefile.env
40
41INCDIRS += \
42	-I$(SRCDIR)/../ngs
43
44#-------------------------------------------------------------------------------
45# outer targets
46#
47all std: makedirs
48	@ $(MAKE_CMD) $(TARGDIR)/std
49
50$(INT_LIBS): makedirs jnihdrs
51	@ $(MAKE_CMD) $(ILIBDIR)/$@
52
53$(EXT_LIBS): makedirs jnihdrs
54	@ $(MAKE_CMD) $(LIBDIR)/$@
55
56.PHONY: all std $(ALL_LIBS)
57
58#-------------------------------------------------------------------------------
59# std
60#
61$(TARGDIR)/std: \
62	$(addprefix $(ILIBDIR)/,$(INT_LIBS)) \
63	$(addprefix $(LIBDIR)/,$(EXT_LIBS))
64
65.PHONY: $(TARGDIR)/std
66
67#-------------------------------------------------------------------------------
68# clean
69#
70clean: stdclean
71
72.PHONY: clean
73
74#-------------------------------------------------------------------------------
75# JNI headers
76#
77jnihdrs: # headers-generated
78
79$(CLSPATH)/ngs-java.jar:
80	@ echo "don't know where $@ is"
81
82JNI_BASE =  \
83	Manager
84
85JNI_INC = \
86	$(addprefix jni_,$(addsuffix .h,$(JNI_BASE)))
87
88headers-generated: $(CLSPATH)/ngs-java.jar
89	javah -classpath $^ $(addprefix gov.nih.nlm.ncbi.ngs.,$(JNI_BASE))
90	@ echo 'for f in gov_nih_nlm_ncbi_ngs_*.h; do mv $$f jni_$${f#gov_nih_nlm_ncbi_ngs_}; done' | bash
91	@ touch $@
92
93#-------------------------------------------------------------------------------
94# ncbi-ngs-jni
95#
96$(ILIBDIR)/libngs-jni: $(addprefix $(ILIBDIR)/libngs-jni.,$(LIBX))
97
98JNI_FIXED =  \
99	String   \
100	ErrorMsg
101
102JNI_SRC = \
103	$(addprefix jni_,$(JNI_BASE) $(JNI_FIXED))
104
105JNI_OBJ = \
106	$(addsuffix .$(LOBX),$(JNI_SRC))
107
108$(ILIBDIR)/libngs-jni.$(LIBX): $(JNI_OBJ)
109	$(LD) --slib -o $@ $^
110
111#-------------------------------------------------------------------------------
112# fuzz
113#
114fuzz: std
115	cp $(addsuffix .$(LIBX),$(addprefix $(ILIBDIR)/,$(INT_LIBS))) $(FLIBDIR)/
116