summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-04-16 13:49:16 +0300
committerTimo Teras <timo.teras@iki.fi>2009-04-16 13:49:16 +0300
commitaf1b460033d874f1b1fd5ac248d49b0a6bb7363a (patch)
tree08cd843c3f9b035ca38190f8bd4829a095da40f8 /src/Makefile
parent9c5200f0e19496e9f0e5248038222077c0763262 (diff)
downloadapk-tools-af1b460033d874f1b1fd5ac248d49b0a6bb7363a.tar.bz2
apk-tools-af1b460033d874f1b1fd5ac248d49b0a6bb7363a.tar.xz
build: rewrite make system to something slightly similar to kbuild
Tracks now probler header file dependencies and command line parameters used to build files. E.g. changing CFLAGS rebuild all C-files. And changing version rebuild now the files where it's used.
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile57
1 files changed, 12 insertions, 45 deletions
diff --git a/src/Makefile b/src/Makefile
index d4a7244..993ca91 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,50 +1,17 @@
-# Makefile - one file to rule them all, one file to bind them
-#
-# Copyright (C) 2007 Timo Teräs <timo.teras@iki.fi>
-# All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 3 as published
-# by the Free Software Foundation. See http://www.gnu.org/ for details.
+progs-y += apk
+apk-objs := state.o database.o package.o archive.o \
+ version.o io.o url.o gunzip.o blob.o \
+ hash.o md5.o apk.o \
+ add.o del.o ver.o index.o info.o search.o \
+ fetch.o audit.o
+CFLAGS_apk.o := -DAPK_VERSION=\"$(FULL_VERSION)\"
-TARGETS = apk
+progs-$(STATIC) += apk.static
+apk.static-objs := $(apk-objs)
+LDFLAGS_apk.static := -static
-apk_OBJS = \
- state.o \
- database.o \
- package.o \
- archive.o \
- version.o \
- io.o \
- url.o \
- gunzip.o \
- blob.o \
- hash.o \
- md5.o \
- add.o \
- del.o \
- ver.o \
- index.o \
- info.o \
- search.o \
- fetch.o \
- audit.o \
- apk.o
-
-ALL_OBJS = $(apk_OBJS)
-
-all: $(TARGETS)
-
-apk: $(apk_OBJS)
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-apk.static: $(apk_OBJS)
- $(CC) $(LDFLAGS) -static -o $@ $^ $(LIBS)
-
-clean::
- @rm -f $(TARGETS) $(ALL_OBJS)
+LIBS := /usr/lib/libz.a
install::
$(INSTALLDIR) $(DESTDIR)$(SBINDIR)
- $(INSTALL) $(TARGETS) $(DESTDIR)$(SBINDIR)
-
+ $(INSTALL) $(obj)/apk $(DESTDIR)$(SBINDIR)