Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Git Source Tree
Root/
| 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 | |
| 12 | CFLAGS = -Wall -g -Wextra -Wno-unused-parameter -fPIC |
| 13 | LDFLAGS = -L. -Wl,-rpath=$(shell pwd) |
| 14 | LDLIBS = -lfakefile |
| 15 | |
| 16 | LIBFAKEFILE_OBJS = comm.o fakefile.o file.o launch.o |
| 17 | LIBFFSLAVE_OBJS = comm.o slave.o |
| 18 | TARGETS = libfakefile.so libfakefile_slave.so demo |
| 19 | |
| 20 | CC_normal := $(CC) |
| 21 | LD_normal := $(LD) |
| 22 | DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG |
| 23 | |
| 24 | CC_quiet = @echo " CC " $@ && $(CC_normal) |
| 25 | LD_quiet = @echo " LD " $@ && $(LD_normal) |
| 26 | GEN_quiet = @echo " GENERATE " $@ && |
| 27 | DEPEND_quiet = @$(DEPEND_normal) |
| 28 | |
| 29 | ifeq ($(V),1) |
| 30 | CC = $(CC_normal) |
| 31 | LD = $(LD_normal) |
| 32 | GEN = |
| 33 | DEPEND = $(DEPEND_normal) |
| 34 | else |
| 35 | CC = $(CC_quiet) |
| 36 | LD = $(LD_quiet) |
| 37 | GEN = $(GEN_quiet) |
| 38 | DEPEND = $(DEPEND_quiet) |
| 39 | endif |
| 40 | |
| 41 | .PHONY: all clean spotless |
| 42 | |
| 43 | all: $(TARGETS) |
| 44 | |
| 45 | libfakefile.so: $(LIBFAKEFILE_OBJS) |
| 46 | $(LD) -shared -o $@ $^ |
| 47 | |
| 48 | libfakefile_slave.so: $(LIBFFSLAVE_OBJS) |
| 49 | $(LD) -shared -o $@ $^ -ldl |
| 50 | |
| 51 | clean: |
| 52 | rm -f $(LIBFAKEFILE_OBJS) $(LIBFFSLAVE_OBJS) |
| 53 | |
| 54 | spotless: clean |
| 55 | rm -f $(TARGETS) |
| 56 |
Branches:
master
