Advertisement
Guest User

Untitled

a guest
May 31st, 2019
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.73 KB | None | 0 0
  1. # macros
  2. PLATFORM != uname -s
  3.  
  4. .if "${PLATFORM}" == "OpenBSD"
  5. CC   := clang
  6. .else
  7. CC   := gcc
  8. .endif
  9.  
  10. CFLAGS   := -pedantic -std=c89
  11. LDFLAGS  :=
  12. TARGETS  := main
  13. HEADERS  :=
  14. OBJ  := main.o
  15.  
  16. # OpenBSD specific SUFFIXES special target
  17. .SUFFIXES: .c .o
  18.  
  19. # *.c to *.o inferred transformation
  20. # (object file building)
  21. # NOTE: standard makefiles require explicit object deps
  22. .c.o:
  23.     ${CC} ${CFLAGS} -c $<
  24.  
  25. # complete binary building ('make all')
  26. all: ${OBJ}
  27.     ${CC} ${CFLAGS} ${LDFLAGS} -o ${TARGETS} ${OBJ}
  28.  
  29. clean:
  30.     rm -f ${OBJ} ${TARGETS}
  31.  
  32. # OPTIONAL: dependency rules for headers
  33. # ${OBJ}: ${HEADERS}
  34.  
  35. # OPTIONAL: special rules of selected binaries
  36. # b.o: b.c
  37. #   ${CC} -D SPECIAL_OPTION ${CFLAGS} ${LDFLAGS} -o $@ $<
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement