256c25473a2cc5e0c27b696d241bdde4d99cfb31
[oweals/opkg-lede.git] / Makefile.am
1 #SUBDIRS = etc replace familiar libbb
2 SUBDIRS = etc familiar libbb
3
4 HOST_CPU=@host_cpu@
5 BUILD_CPU=@build_cpu@
6 OPKGLIBDIR=@opkglibdir@ 
7 ALL_CFLAGS=-g -O -Wall -DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\"
8
9 bin_PROGRAMS = opkg-cl
10
11 lib_LTLIBRARIES = libopkg.la
12
13 bin_SCRIPTS = update-alternatives
14
15 interceptdir = $(datadir)/opkg/intercept
16 intercept_DATA = intercept/ldconfig intercept/depmod intercept/update-modules
17
18 install-data-hook:
19         chmod +x $(DESTDIR)$(datadir)/opkg/intercept/*
20
21 # opkg_LDADD = libbb/libbb.a replace/libreplace.a
22
23 #opkg_cl_LDADD = libopkg.la libbb/libbb.la replace/libreplace.a 
24 opkg_cl_LDADD = libopkg.la libbb/libbb.la 
25
26 libopkg_includedir=$(includedir)/libopkg
27
28 libopkg_include_HEADERS= \
29         args.h \
30         conffile.h \
31         conffile_list.h \
32         config.h \
33         hash_table.h \
34         includes.h \
35         opkg_conf.h \
36         opkg.h \
37         opkg_message.h \
38         opkg_state.h \
39         nv_pair.h \
40         nv_pair_list.h \
41         pkg_depends.h \
42         pkg_dest.h \
43         pkg_dest_list.h \
44         pkg.h \
45         pkg_hash.h \
46         pkg_src.h \
47         pkg_src_list.h \
48         pkg_vec.h \
49         str_list.h \
50         void_list.h \
51         libopkg.h 
52
53 #\ replace/replace.h
54
55 #libopkg_la_LIBADD = libbb/libbb.la replace/libreplace.a
56 libopkg_la_LIBADD = libbb/libbb.la $(CURL_LIBS) $(GPGME_LIBS)
57
58 opkg_core_sources = args.c args.h opkg.c \
59                     user.c user.h 
60 opkg_libcore_sources = args.c args.h libopkg.c libopkg.h opkg.h\
61                     user.c user.h opkg_state.c opkg_state.h
62 opkg_cmd_sources = opkg_cmd.c opkg_cmd.h \
63                    opkg_configure.c opkg_configure.h \
64                    opkg_download.c opkg_download.h \
65                    opkg_install.c opkg_install.h \
66                    opkg_upgrade.c opkg_upgrade.h \
67                    opkg_remove.c opkg_remove.h
68 opkg_db_sources = opkg_conf.c opkg_conf.h \
69                   opkg_utils.c opkg_utils.h pkg.c pkg.h hash_table.h \
70                   pkg_depends.c pkg_depends.h pkg_extract.c pkg_extract.h \
71                   hash_table.c pkg_hash.c pkg_hash.h pkg_parse.c pkg_parse.h \
72                   pkg_vec.c pkg_vec.h
73 opkg_list_sources = conffile.c conffile.h conffile_list.c conffile_list.h \
74                     nv_pair.c nv_pair.h nv_pair_list.c nv_pair_list.h \
75                     pkg_dest.c pkg_dest.h pkg_dest_list.c pkg_dest_list.h \
76                     pkg_src.c pkg_src.h pkg_src_list.c pkg_src_list.h \
77                     str_list.c str_list.h void_list.c void_list.h
78 opkg_util_sources = file_util.c file_util.h opkg_message.h opkg_message.c md5.c md5.h \
79                     sprintf_alloc.c sprintf_alloc.h str_util.c str_util.h \
80                     xregex.c xregex.h xsystem.c xsystem.h
81
82 # opkg_SOURCES = $(opkg_core_sources) $(opkg_cmd_sources) $(opkg_db_sources) \
83 #              $(opkg_util_sources) $(opkg_list_sources)
84
85 EXTRA_DIST = opkg.c update-alternatives $(intercept_DATA)
86
87 MAINTAINERCLEANFILES= \
88         configure \
89         Makefile.in \
90         config.guess \
91         config.sub \
92         ltmain.sh \
93         .Makefile.am.swp \
94         aclocal.m4
95
96 libopkg_la_SOURCES = $(opkg_libcore_sources) $(opkg_cmd_sources) $(opkg_db_sources) \
97                $(opkg_util_sources) $(opkg_list_sources)
98
99 opkg_cl_SOURCES = opkg-frontend.c
100
101 libopkg_la_CFLAGS = -DOPKG_LIB $(ALL_CFLAGS)  $(CURL_CFLAGS) $(GPGME_CFLAGS)
102
103 opkg_CFLAGS = $(ALL_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS)
104
105 opkg_cl_CFLAGS = -DOPKG_LIB $(ALL_CFLAGS)
106
107 noinst_PROGRAMS = opkg_hash_test opkg_extract_test
108
109 opkg_hash_test_LDADD = libbb/libbb.la
110 opkg_hash_test_SOURCES = opkg_hash_test.c $(opkg_db_sources) $(opkg_util_sources) $(opkg_list_sources)
111 opkg_hash_test_CFLAGS = $(ALL_CFLAGS)
112
113 opkg_extract_test_LDADD = libbb/libbb.la
114 opkg_extract_test_SOURCES = opkg_extract_test.c $(opkg_db_sources) $(opkg_util_sources) $(opkg_list_sources)
115 opkg_extract_test_CFLAGS = $(ALL_CFLAGS)
116
117 package: all-recursive
118         STRIPPROG=$(STRIP) familiar/rules INSTALL=$$PWD/install-sh  binary-arch