Root/fakefile/Makefile

Source at commit 51106cf9b34d773e72aa00385c80a9abb76b28df created 5 years 11 months ago.
By Werner Almesberger, ircstat/ML: update for 11/2013
1#
2# Makefile - Build the Fakefile libraries
3#
4# Copyright 2012 by Werner Almesberger
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11
12CFLAGS = -Wall -g -Wextra -Wno-unused-parameter -fPIC
13LDFLAGS = -L. -Wl,-rpath=$(shell pwd)
14LDLIBS = -lfakefile
15
16LIBFAKEFILE_OBJS = comm.o fakefile.o file.o launch.o
17LIBFFSLAVE_OBJS = comm.o slave.o
18TARGETS = libfakefile.so libfakefile_slave.so demo
19
20CC_normal := $(CC)
21LD_normal := $(LD)
22DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
23
24CC_quiet = @echo " CC " $@ && $(CC_normal)
25LD_quiet = @echo " LD " $@ && $(LD_normal)
26GEN_quiet = @echo " GENERATE " $@ &&
27DEPEND_quiet = @$(DEPEND_normal)
28
29ifeq ($(V),1)
30    CC = $(CC_normal)
31    LD = $(LD_normal)
32    GEN =
33    DEPEND = $(DEPEND_normal)
34else
35    CC = $(CC_quiet)
36    LD = $(LD_quiet)
37    GEN = $(GEN_quiet)
38    DEPEND = $(DEPEND_quiet)
39endif
40
41.PHONY: all clean spotless
42
43all: $(TARGETS)
44
45libfakefile.so: $(LIBFAKEFILE_OBJS)
46        $(LD) -shared -o $@ $^
47
48libfakefile_slave.so: $(LIBFFSLAVE_OBJS)
49        $(LD) -shared -o $@ $^ -ldl
50
51clean:
52        rm -f $(LIBFAKEFILE_OBJS) $(LIBFFSLAVE_OBJS)
53
54spotless: clean
55        rm -f $(TARGETS)
56

Archive Download this file

Branches:
master



interactive