bb33843876149fc444eded0d27442157ebcce840
[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         nv_pair.h \
39         nv_pair_list.h \
40         pkg_depends.h \
41         pkg_dest.h \
42         pkg_dest_list.h \
43         pkg.h \
44         pkg_hash.h \
45         pkg_src.h \
46         pkg_src_list.h \
47         pkg_vec.h \
48         str_list.h \
49         void_list.h \
50         libopkg.h 
51
52 #\ replace/replace.h
53
54 #libopkg_la_LIBADD = libbb/libbb.la replace/libreplace.a
55 libopkg_la_LIBADD = libbb/libbb.la $(CURL_LIBS) $(GPGME_LIBS)
56
57 opkg_core_sources = args.c args.h opkg.c \
58                     user.c user.h 
59 opkg_libcore_sources = args.c args.h libopkg.c libopkg.h opkg.h\
60                     user.c user.h 
61 opkg_cmd_sources = opkg_cmd.c opkg_cmd.h \
62                    opkg_configure.c opkg_configure.h \
63                    opkg_download.c opkg_download.h \
64                    opkg_install.c opkg_install.h \
65                    opkg_upgrade.c opkg_upgrade.h \
66                    opkg_remove.c opkg_remove.h
67 opkg_db_sources = opkg_conf.c opkg_conf.h \
68                   opkg_utils.c opkg_utils.h pkg.c pkg.h hash_table.h \
69                   pkg_depends.c pkg_depends.h pkg_extract.c pkg_extract.h \
70                   hash_table.c pkg_hash.c pkg_hash.h pkg_parse.c pkg_parse.h \
71                   pkg_vec.c pkg_vec.h
72 opkg_list_sources = conffile.c conffile.h conffile_list.c conffile_list.h \
73                     nv_pair.c nv_pair.h nv_pair_list.c nv_pair_list.h \
74                     pkg_dest.c pkg_dest.h pkg_dest_list.c pkg_dest_list.h \
75                     pkg_src.c pkg_src.h pkg_src_list.c pkg_src_list.h \
76                     str_list.c str_list.h void_list.c void_list.h
77 opkg_util_sources = file_util.c file_util.h opkg_message.h opkg_message.c md5.c md5.h \
78                     sprintf_alloc.c sprintf_alloc.h str_util.c str_util.h \
79                     xregex.c xregex.h xsystem.c xsystem.h
80
81 # opkg_SOURCES = $(opkg_core_sources) $(opkg_cmd_sources) $(opkg_db_sources) \
82 #              $(opkg_util_sources) $(opkg_list_sources)
83
84 EXTRA_DIST = opkg.c update-alternatives $(intercept_DATA)
85
86 MAINTAINERCLEANFILES= \
87         configure \
88         Makefile.in \
89         config.guess \
90         config.sub \
91         ltmain.sh \
92         .Makefile.am.swp \
93         aclocal.m4
94
95 libopkg_la_SOURCES = $(opkg_libcore_sources) $(opkg_cmd_sources) $(opkg_db_sources) \
96                $(opkg_util_sources) $(opkg_list_sources)
97
98 opkg_cl_SOURCES = opkg-frontend.c
99
100 libopkg_la_CFLAGS = -DOPKG_LIB $(ALL_CFLAGS)  $(CURL_CFLAGS) $(GPGME_CFLAGS)
101
102 opkg_CFLAGS = $(ALL_CFLAGS) $(CURL_CFLAGS) $(GPGME_CFLAGS)
103
104 opkg_cl_CFLAGS = -DOPKG_LIB $(ALL_CFLAGS)
105
106 noinst_PROGRAMS = opkg_hash_test opkg_extract_test
107
108 opkg_hash_test_LDADD = libbb/libbb.la
109 opkg_hash_test_SOURCES = opkg_hash_test.c $(opkg_db_sources) $(opkg_util_sources) $(opkg_list_sources)
110 opkg_hash_test_CFLAGS = $(ALL_CFLAGS)
111
112 opkg_extract_test_LDADD = libbb/libbb.la
113 opkg_extract_test_SOURCES = opkg_extract_test.c $(opkg_db_sources) $(opkg_util_sources) $(opkg_list_sources)
114 opkg_extract_test_CFLAGS = $(ALL_CFLAGS)
115
116 package: all-recursive
117         STRIPPROG=$(STRIP) familiar/rules INSTALL=$$PWD/install-sh  binary-arch