Advertisement
Mark2020H

Make file for compiling source code

Apr 27th, 2020
1,245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.70 KB | None | 0 0
  1. # change application name here (executable output name)
  2.  
  3. # ******  Full code and image at https://github.com/markh2016/GTKSingleRPILightSwitch.git *****
  4. TARGET=Switch
  5.  
  6. # compiler
  7. CC=gcc
  8. # debug
  9. DEBUG=-g
  10. # optimisation
  11. OPT=-O0
  12. # warnings
  13. WARN=-Wall
  14.  
  15. LIB=-L/usr/local/lib/
  16. INC=-I/usr/local/include -lbcm2835
  17.  
  18.  
  19. PTHREAD=-pthread
  20.  
  21. CCFLAGS=$(DEBUG) $(OPT) $(WARN) $(PTHREAD) -pipe
  22.  
  23. GTKLIB=`pkg-config --cflags --libs gtk+-3.0`
  24.  
  25. # linker
  26. LD=gcc -rdynamic
  27. LDFLAGS=$(PTHREAD) $(GTKLIB)
  28.  
  29. OBJS=main.o
  30.  
  31. all: $(OBJS)
  32.     $(LD) -o $(TARGET) $(OBJS) $(LDFLAGS) $(LIB) $(INC)
  33.    
  34. main.o: main.c
  35.     $(CC) -c $(CCFLAGS) $(LIB) $(INC) main.c $(GTKLIB) -o main.o
  36.    
  37. clean:
  38.     rm -f *.o $(TARGET)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement