lsflib/tools/Makefile
author Markus Brökers <mbroeker@largo.homelinux.org>
Tue, 17 Aug 2010 18:57:57 +0200
changeset 139 cb1d3f4cf18e
parent 66 2b4f786d9073
child 166 ecd6492274ad
permissions -rw-r--r--
execve returns a value on error and this catches it

      CC = gcc
     CPP = g++
   STRIP = strip -s
 INSTALL = cp -f
      RM = rm -f
  CFLAGS = -Wall -Wstrict-prototypes
 INCLUDE = -I/usr/local/include
 LDFLAGS = -L/usr/local/lib/ -llsf -Wl,--rpath,lib

OBJECTS  = cpuid.o
OBJECTS += main.o
OBJECTS += digest.o
OBJECTS += dump.o
OBJECTS += list.o

TARGET = progs

.c.o:
	$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<

all: progs

progs: $(OBJECTS)
	$(CC) $(LDFLAGS) digest.o -o digest
	$(CC) $(LDFLAGS) dump.o -o dump
	$(CC) $(LDFLAGS) cpuid.o main.o -o cpuid
	$(CC) $(LDFLAGS) list.o -o list

	$(STRIP) digest
	$(STRIP) cpuid
	$(STRIP) dump
	$(STRIP) list

.PHONY: clean distclean

clean:
	$(RM) *.o
	$(RM) *~
	$(RM) digest cpuid dump list

distclean:
	@make clean

install: progs
	$(INSTALL) digest $(HOME)/bin/
	$(INSTALL) cpuid $(HOME)/bin/
	$(INSTALL) dump $(HOME)/bin/
	$(INSTALL) list $(HOME)/bin/

uninstall:
	$(RM) $(HOME)/bin/digest
	$(RM) $(HOME)/bin/list
	$(RM) $(HOME)/bin/cpuid
	$(RM) $(HOME)/bin/dump