X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=doc%2Fexamples%2FMakefile.examples.template;h=e6196f53104f37796a03fd83320541a436710b32;hp=4d26cb03d73faecc4e81d8dee5e6e3856c19babd;hb=HEAD;hpb=483370758193a1d58f4668c3d53ae2b5fe1e66c3 diff --git a/doc/examples/Makefile.examples.template b/doc/examples/Makefile.examples.template index 4d26cb0..21cac7b 100644 --- a/doc/examples/Makefile.examples.template +++ b/doc/examples/Makefile.examples.template @@ -1,27 +1,24 @@ -# Copyright (C) 2013 Mathieu Desnoyers -# -# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED -# OR IMPLIED. ANY USE IS AT YOUR OWN RISK. -# -# Permission is hereby granted to use or copy this program for any -# purpose, provided the above notices are retained on all copies. -# Permission to modify the code and to distribute modified code is -# granted, provided the above notices are retained, and a notice that -# the code was modified is included with the above copyright notice. +# SPDX-FileCopyrightText: 2013 Mathieu Desnoyers # +# SPDX-License-Identifier: MIT + # This makefile is purposefully kept simple to support GNU and BSD make. -CC = gcc -CFLAGS = -g -O2 -Wall +LOCAL_CFLAGS := -g -O2 -Wall +AM_V_P := : all: $(BINARY) $(BINARY): $(OBJECTS) - $(CC) $(CFLAGS) $(LDFLAGS) $(AM_CFLAGS) $(AM_LDFLAGS) \ - $(LIBS) -o $@ $(OBJECTS) + @verbose="$(AM_V_P)"; if [ "x$$verbose" = "x" ]; then verbose=":"; fi; \ + if $$verbose; then set -x; else echo " CCLD $@"; fi; \ + $(CC) $(LOCAL_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ $(OBJECTS) $(LIBS) -$(OBJECTS): $(SOURCES) - $(CC) $(CPPFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(AM_CFLAGS) \ +$(OBJECTS): $(SOURCES) $(DEPS) + @verbose="$(AM_V_P)"; if [ "x$$verbose" = "x" ]; then verbose=":"; fi; \ + if $$verbose; then set -x; else echo " CC $@"; fi; \ + $(CC) $(LOCAL_CFLAGS) $(AM_CFLAGS) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) \ -c -o $@ $(SOURCES) .PHONY: clean