Guest User

Untitled

a guest
Nov 1st, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.36 KB | None | 0 0
  1. SDIR =src
  2. ODIR =obj
  3. LDIR =lib
  4. IDIR =include
  5.  
  6. CC=gcc
  7. CFLAGS=-I $(IDIR)
  8.  
  9. LIBS=-lm
  10.  
  11.  
  12. DEPS = $(wildcard $(IDIR)/*.h)
  13. OBJ = $(wildcard $(ODIR)/*.o)
  14. SRC = $(wildcard $(SDIR)/*.c)
  15.  
  16. $(ODIR)/%.o: %.c $(DEPS)
  17.     $(CC) -c -o $@ $< $(CFLAGS)
  18.  
  19. main: $(OBJ)
  20.     $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  21.  
  22.  
  23. .PHONY: clean
  24.  
  25. clean:
  26.     rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~
Advertisement
Add Comment
Please, Sign In to add comment