You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.4 KiB

  1. # Compiler to use. Make does something special with this.
  2. CC = gcc
  3. CFLAGS = -I"/usr/include/SDL2" -g -Wall -lSDL2
  4. ODIR = obj
  5. SDIR = src
  6. _DEPS = SDL_Clicky.h clickable.h clickable_hierarchy.h containers/containers.h
  7. DEPS = $(patsubst %,$(SDIR)/%,$(_DEPS))
  8. _SRC = SDL_Clicky.c clickable.c clickable_hierarchy.c containers/containers.c
  9. SRC = $(patsubst %,$(SDIR)/%,$(_SRC))
  10. _OBJS = $(_SRC:.c=.o)
  11. OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
  12. OUT = out/libSDL_Clicky.a
  13. # Rules that are always executed regardless of file states.
  14. .POHNY: clean force forceobjs
  15. # Name isn't special, it's just befitting of being the first rule. The first rule is executed if no rule is specified.
  16. make: $(OUT)
  17. # echo $(OBJS) #Uncomment this line to see if the target gets run or just to get a list of the objs or whatever.
  18. $(ODIR)/%.o: $(SDIR)/%.c $(DEPS)
  19. $(CC) $(CFLAGS) -c $< -o $@
  20. #obj/SDL_Clicky.o: src/SDL_Clicky.c $(DEPS)
  21. # $(CC) -c $< -o $@
  22. #obj/%.o: src/%.c $(DEPS)
  23. # $(CC) -c $< -o $@
  24. # Compiling the actual build.
  25. $(OUT): $(OBJS)
  26. #$(CC) $(OBJS) -c -o obj/libSDL_Clicky.o;
  27. #ar rcs $(OUT) obj/libSDL_Clicky.o;
  28. ar rcs $(OUT) $(OBJS);
  29. # Primitive targets for forcing a compilation. Cleans up after themselves. NOT UPDATED FOR USE HERE! IT WAS COPY-PASTED FROM ELSEWHERE!
  30. forceobjs:
  31. $(CC) -c $(SRC)
  32. force: forceobjs
  33. $(CC) $(_OBJS) -o $(OUT); rm *.o
  34. # Rule that is always executed regardless of the states of the files. Deletes junk.
  35. clean:
  36. rm $(OUT) $(ODIR)/*.o;
  37. asdf:
  38. echo $(OBJS)