summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/Makefile41
-rw-r--r--src/pacman/Makefile.am20
-rw-r--r--src/pacman/pacman.c2
-rw-r--r--src/util/Makefile.am11
4 files changed, 32 insertions, 42 deletions
diff --git a/src/pacman/Makefile b/src/pacman/Makefile
deleted file mode 100644
index a6b6cad2..00000000
--- a/src/pacman/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-
-CC=gcc
-CFLAGS=-g -Wall -D_GNU_SOURCE -I. -I../.. -I../../lib/libalpm -I../../lib/libftp
-LDFLAGS=-L../../lib/libalpm -lalpm -L../../lib/libftp -lftp -ltar -lz
-AR=ar rc
-RAN=ranlib
-
-OBJECTS=util.o \
- log.o \
- list.o \
- package.o \
- db.o \
- download.o \
- trans.o \
- add.o \
- remove.o \
- upgrade.o \
- query.o \
- sync.o \
- conf.o \
- pacman.o
-
-all: pacman
-
-%.o: %.c %.h
- $(CC) -c $(CFLAGS) -o $@ $<
-
-pacman: $(OBJECTS) ../../lib/libalpm/libalpm.a ../../lib/libftp/libftp.a
- $(CC) $(OBJECTS) -o $@ $(CFLAGS) $(LDFLAGS)
-# $(CC) $(OBJECTS) -o $@.static $(CFLAGS) $(LDFLAGS)
-
-clean:
- rm -f *.o *~ core
- rm -f pacman pacman.static convertdb vercmp
-
-install: pacman vercmp convertdb
- $(INSTALL) -D -m0755 pacman $(DESTDIR)$(BINDIR)/pacman
- $(INSTALL) -D -m0755 pacman.static $(DESTDIR)$(BINDIR)/pacman.static
- $(INSTALL) -D -m0755 vercmp $(DESTDIR)$(BINDIR)/vercmp
- $(INSTALL) -D -m0755 convertdb $(DESTDIR)$(BINDIR)/convertdb
-
diff --git a/src/pacman/Makefile.am b/src/pacman/Makefile.am
new file mode 100644
index 00000000..f8450b86
--- /dev/null
+++ b/src/pacman/Makefile.am
@@ -0,0 +1,20 @@
+bin_PROGRAMS = pacman pacman.static
+
+AM_CFLAGS = -D_GNU_SOURCE \
+ -I$(top_srcdir)/lib/libalpm \
+ -I$(top_srcdir)/lib/libftp
+
+pacman_SOURCES = util.c log.c list.c package.c db.c download.c trans.c add.c \
+ remove.c upgrade.c query.c sync.c conf.c pacman.c
+
+pacman_static_SOURCES = $(pacman_SOURCES)
+
+pacman_LDADD = \
+ $(top_srcdir)/lib/libalpm/libalpm.la \
+ $(top_srcdir)/lib/libftp/libftp.la
+
+pacman_static_LDADD = \
+ $(top_srcdir)/lib/libalpm/.libs/libalpm.a \
+ $(top_srcdir)/lib/libftp/.libs/libftp.a $(LDFLAGS)
+
+pacman_static_LDFLAGS = -all-static
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 983d8402..00be4b83 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -591,7 +591,7 @@ void usage(int op, char *myname)
void version()
{
printf("\n");
- printf(" .--. Pacman v%s\n", PM_VERSION);
+ printf(" .--. Pacman v%s - libalpm v%s\n", PACMAN_VERSION, PM_VERSION);
printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2005 Judd Vinet <jvinet@zeroflux.org>\n");
printf("\\ '-. '-' '-' '-' \n");
printf(" '--' This program may be freely redistributed under\n");
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
new file mode 100644
index 00000000..8fd81471
--- /dev/null
+++ b/src/util/Makefile.am
@@ -0,0 +1,11 @@
+bin_PROGRAMS = vercmp convertdb
+
+AM_CFLAGS = \
+ -I$(top_srcdir)/lib/libalpm \
+ -I$(top_srcdir)/src/pacman
+
+vercmp_SOURCES = vercmp.c
+convertdb_SOURCES = convertdb.c
+
+vercmp_LDADD = $(top_srcdir)/lib/libalpm/libalpm.la
+convertdb_LDADD = $(top_srcdir)/lib/libalpm/libalpm.la