• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5PKGS := glib-2.0 dbus-glib-1
6PKG_CONFIG ?= pkg-config
7PKG_CFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKGS))
8PKG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKGS))
9
10CFLAGS ?= -O2
11CFLAGS += $(PKG_CFLAGS)
12CFLAGS += -g
13WARN := -Werror -Wall
14CFLAGS += $(WARN)
15
16all: fakemodem fakenet
17.PHONY: all clean install
18
19fakemodem: fakemodem.c fakemodem-dbus.h
20	$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< $(PKG_LIBS)
21
22fakemodem-dbus.h: fakemodem-dbus.xml
23	dbus-binding-tool --mode=glib-server --prefix=fakemodem \
24		$< > $@.tmp
25	mv $@.tmp $@
26
27fakenet: fakenet.c
28	$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)  $<
29
30install:
31	install -m 0755 -d $(DESTDIR)/bin
32	install -m 0755 fakemodem fakenet $(DESTDIR)/bin
33
34clean:
35	rm -f core fakemodem fakenet *.o *.so fakemodem-dbus.h
36