Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Makefile:
- ```
- # Makefile for Writing Make Files Example
- # *****************************************************
- # Variables to control Makefile operation
- # the compiler: gcc for C program, define as g++ for C++
- CC = g++
- # compiler flags:
- # -g - this flag adds debugging information to the executable file
- # -Wall - this flag is used to turn on most compiler warnings
- CFLAGS = -Wall -g -std=c++14
- # ****************************************************
- # Targets needed to bring the executable up to date
- # The build target
- TARGET = AccountTest
- OUT = app
- main: $(TARGET).o
- $(CC) $(CFLAGS) -o $(OUT) $(TARGET).o
- # The main.o target can be written more simply
- $(TARGET).o: $(TARGET).cpp
- $(CC) $(CFLAGS) -c $(TARGET).cpp
- clean:
- $(RM) $(OUT) $(TARGET).o
- ```
- Output for make:
- ```
- $ make
- g++ -Wall -g -std=c++14 -c AccountTest.cpp
- g++ -Wall -g -std=c++14 -o app AccountTest.o
- $
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement