Advertisement
MBJ

Stack_Error_Makefile

MBJ
Jun 19th, 2020
2,325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.68 KB | None | 0 0
  1. # -*- MakeFile -*-
  2. # The make file for the C and C++ files in this directory
  3.  
  4. #target: dependencies
  5.     #action # MUST BE A TAB, that first line (allegedly) tells editor to use tab not spaces
  6.  
  7. # dependencies: Anything that's needed to build your .o files and executables
  8. # .h files are included too! Because if they change but not the .c file itself, it won't get
  9.             # recompiled...
  10.  
  11. all: main
  12.  
  13. main: main.o bubbleSort.o
  14.     gcc main.o bubbleSort.o -o main # -l m
  15.  
  16. bubbleSort.o: bubbleSort.c
  17.     gcc -g -c bubbleSort.c
  18.  
  19. main.o: main.c bubbleSort.h
  20.     gcc -g -c main.c
  21.  
  22. clean:
  23.     rm *.o main
  24. # removing all .o's, and the 2 executables
  25.  
  26. # Now everything works, can we make it better though?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement