File: Makefile.example

package info (click to toggle)
lcalc 2.0.5-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,176 kB
  • sloc: cpp: 13,670; makefile: 111; sh: 77
file content (27 lines) | stat: -rw-r--r-- 766 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This being the first target defined, it is the default that will be
# built when you run "make". The standard "make" utility has built-in
# rules that tell it how to build programs from source files, but not
# for C++:
#
#   https://pubs.opengroup.org/onlinepubs/9699919799/
#
# Here we implement something similar for C++ programs contained in
# .cc source files. This, we hope, ensures that this Makefile will
# work with non-GNU implementations of Make.
example: example.o

# POSIX does not specify a default for this, so we try "c++"
# because that's what GNU Make does.
CXX ?= c++
LIBS ?= -lLfunction

.SUFFIXES: .cc .o
.cc.o:
	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $<

.o:
	$(CXX) $(LDFLAGS) $< $(LIBS) -o $@

.PHONY: clean
clean:
	rm -f example.o example