Added standard I/O stream examples
This commit is contained in:
parent
c2103cdc4c
commit
8b87ead3b9
3 changed files with 73 additions and 0 deletions
40
lab1/stream-examples/Makefile
Normal file
40
lab1/stream-examples/Makefile
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# Define the compiler and the linker. The linker must be defined since
|
||||
# the implicit rule for linking uses CC as the linker. g++ can be
|
||||
# changed to clang++.
|
||||
CXX = g++
|
||||
CC = $(CXX)
|
||||
|
||||
# Generate dependencies in *.d files
|
||||
DEPFLAGS = -MT $@ -MMD -MP -MF $*.d
|
||||
|
||||
# Define preprocessor, compiler, and linker flags. Uncomment the # lines
|
||||
# if you use clang++ and wish to use libc++ instead of GNU's libstdc++.
|
||||
# -g is for debugging.
|
||||
CPPFLAGS = -std=c++11 -I.
|
||||
CXXFLAGS = -O2 -Wall -Wextra -pedantic-errors -Wold-style-cast
|
||||
CXXFLAGS += -std=c++11
|
||||
CXXFLAGS += -g
|
||||
CXXFLAGS += $(DEPFLAGS)
|
||||
LDFLAGS = -g
|
||||
#CPPFLAGS += -stdlib=libc++
|
||||
#CXXFLAGS += -stdlib=libc++
|
||||
#LDFLAGS += -stdlib=libc++
|
||||
|
||||
# Targets
|
||||
PROGS = read-words example-out
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
# Phony targets
|
||||
.PHONY: all test clean distclean
|
||||
|
||||
# Standard clean
|
||||
clean:
|
||||
rm -f *.o $(PROGS)
|
||||
|
||||
distclean: clean
|
||||
rm *.d
|
||||
|
||||
# Include the *.d files
|
||||
SRC = $(wildcard *.cc)
|
||||
-include $(SRC:.cc=.d)
|
||||
Loading…
Add table
Add a link
Reference in a new issue