Makefile revision 068fea5040e7dbc38d51bc69645fa28d06dd5acb
1# Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5PKG_CONFIG ?= pkg-config 6PKGS := gudev-1.0 glib-2.0 7PKG_CFLAGS := $(shell ${PKG_CONFIG} --cflags $(PKGS)) 8PKG_LIBS := $(shell ${PKG_CONFIG} --libs $(PKGS)) 9WARN := -Werror -Wall 10DEBUG := -g -DFAKE_G_UDEV_DEBUG 11OPT := -O2 12 13all: gudev-exercise libfakegudev.so 14.PHONY: clean all install 15 16gudev-exercise: gudev-exercise.c 17 $(CC) -o $@ $(WARN) $(OPT) $(DEBUG) $(PKG_CFLAGS) $< $(PKG_LIBS) 18 19libfakegudev.so: fakegudev.c 20 $(CC) -fPIC -shared -o $@ $(WARN) $(OPT) $(DEBUG) $(PKG_CFLAGS) $< -ldl 21 22install: 23 install -m 0755 -d $(DESTDIR)/lib 24 install -m 0755 libfakegudev.so $(DESTDIR)/lib 25 26clean: 27 rm -f core gudev-exercise *.o *.so 28