Use a common mk file for all bins, install bins stripped.

--HG--
extra : convert_revision : dd739bbc9c67b099ef690533e02bb3f40aa2dc8a
This commit is contained in:
Juan RP 2009-02-16 18:03:03 +01:00
parent 1802997b0b
commit e59520869b
7 changed files with 40 additions and 117 deletions

View File

@ -1,25 +1,5 @@
BIN = xbps-bin
OBJS = main.o ../xbps-repo/util.o
TOPDIR = ../.. TOPDIR = ../..
include $(TOPDIR)/vars.mk include $(TOPDIR)/prog.mk
OBJS = main.o ../xbps-repo/util.o
BIN = xbps-bin
all: $(BIN)
.PHONY: all
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN)
clean-objs:
-rm -f *.o
-rm -f ../xbps-repo/util.o
install: $(BIN)
install -d $(SBINDIR)
install -m 755 $(BIN) $(SBINDIR)

View File

@ -1,24 +1,4 @@
BIN = xbps-cmpver
TOPDIR = ../.. TOPDIR = ../..
include $(TOPDIR)/vars.mk include $(TOPDIR)/prog.mk
OBJS = main.o
BIN = xbps-cmpver
all: $(BIN)
.PHONY: all
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN)
clean-objs:
-rm -f *.o
install: $(BIN)
install -d $(SBINDIR)
install -m 755 $(BIN) $(SBINDIR)

View File

@ -1,25 +1,4 @@
BIN = xbps-digest
TOPDIR = ../.. TOPDIR = ../..
include $(TOPDIR)/vars.mk include $(TOPDIR)/prog.mk
EXTRA_CFLAGS = -funroll-all-loops -ftree-loop-linear
OBJS = main.o
BIN = xbps-digest
all: $(BIN)
.PHONY: all
$(BIN): $(OBJS)
$(CC) $(EXTRA_CFLAGS) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN)
clean-objs:
-rm -f *.o
install: $(BIN)
install -d $(SBINDIR)
install -m 755 $(BIN) $(SBINDIR)

View File

@ -1,24 +1,4 @@
BIN = xbps-pkgdb
TOPDIR = ../.. TOPDIR = ../..
include $(TOPDIR)/vars.mk include $(TOPDIR)/prog.mk
OBJS = main.o
BIN = xbps-pkgdb
all: $(BIN)
.PHONY: all
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN)
clean-objs:
-rm -f *.o
install: $(BIN)
install -d $(SBINDIR)
install -m 755 $(BIN) $(SBINDIR)

View File

@ -1,24 +1,5 @@
BIN = xbps-repo
OBJS = main.o util.o
TOPDIR = ../.. TOPDIR = ../..
include $(TOPDIR)/vars.mk include $(TOPDIR)/prog.mk
OBJS = util.o main.o
BIN = xbps-repo
all: $(BIN)
.PHONY: all
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN)
clean-objs:
-rm -f *.o
install: $(BIN)
install -d $(SBINDIR)
install -m 755 $(BIN) $(SBINDIR)

22
prog.mk Normal file
View File

@ -0,0 +1,22 @@
include $(TOPDIR)/vars.mk
OBJS ?= main.o
all: $(BIN)
.PHONY: all
$(BIN): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN)
clean-objs:
-rm -f $(OBJS)
install: $(BIN)
install -d $(SBINDIR)
install $(INSTALL_STRIPPED) -m 755 $(BIN) $(SBINDIR)

View File

@ -5,6 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
LIBDIR ?= $(PREFIX)/lib LIBDIR ?= $(PREFIX)/lib
ETCDIR ?= $(PREFIX)/etc ETCDIR ?= $(PREFIX)/etc
TOPDIR ?= .. TOPDIR ?= ..
INSTALL_STRIPPED ?= -s
LDFLAGS += -L$(TOPDIR)/lib -L$(PREFIX)/lib -lxbps LDFLAGS += -L$(TOPDIR)/lib -L$(PREFIX)/lib -lxbps
CPPFLAGS += -I$(TOPDIR)/include CPPFLAGS += -I$(TOPDIR)/include