Advertisement
Guest User

Untitled

a guest
Apr 15th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.85 KB | None | 0 0
  1. .PHONY: all clean
  2. NAME=cotc
  3. MNAME=merged_$(NAME)
  4. CC=g++
  5. CFLAGS=-pg -g -Wall -pedantic -std=c++11 -DNPROD
  6. LDFLAGS=-lm
  7. SRC=position.cpp ship.cpp state.cpp
  8. HFL=params.h position.h ship.h state.h
  9. TOT=$(SRC) $(HFL)
  10. TESTS=
  11.  
  12. all: merged $(NAME) $(MNAME) $(TESTS)
  13.  
  14. $(MNAME): $(TOT)
  15.     @echo "=============> Compiling the merged $(NAME) <=============="
  16.     $(CC) $(CFLAGS) -o $(MNAME) $(MNAME).cpp $(LDFLAGS)
  17.     rm $(MNAME)
  18.  
  19. $(NAME): $(TOT) main.cpp
  20.     @echo "========> Compiling $(NAME) distributed in files <========="
  21.     $(CC) $(CFLAGS) -o $(NAME) $(SRC) main.cpp $(LDFLAGS)
  22.  
  23. merged: $(SRC)
  24.     @echo "===========> Building merged file for CG <============="
  25.     python3 merge.py
  26.  
  27. $(TESTS): $(TOT)
  28.     @echo "========> Compiling test $@ <========="
  29.     $(CC) $(CFLAGS) -o tests/$@ $(SRC) $@.cpp $(LDFLAGS)
  30.  
  31. clean:
  32.     rm -f *pyc *~ *o $(MNAME).cpp $(MNAME) $(NAME) *#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement