Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # macros
- PLATFORM != uname -s
- .if "${PLATFORM}" == "OpenBSD"
- CC := clang
- .else
- CC := gcc
- .endif
- CFLAGS := -pedantic -std=c89
- LDFLAGS :=
- TARGETS := main
- HEADERS :=
- OBJ := main.o
- # OpenBSD specific SUFFIXES special target
- .SUFFIXES: .c .o
- # *.c to *.o inferred transformation
- # (object file building)
- # NOTE: standard makefiles require explicit object deps
- .c.o:
- ${CC} ${CFLAGS} -c $<
- # complete binary building ('make all')
- all: ${OBJ}
- ${CC} ${CFLAGS} ${LDFLAGS} -o ${TARGETS} ${OBJ}
- clean:
- rm -f ${OBJ} ${TARGETS}
- # OPTIONAL: dependency rules for headers
- # ${OBJ}: ${HEADERS}
- # OPTIONAL: special rules of selected binaries
- # b.o: b.c
- # ${CC} -D SPECIAL_OPTION ${CFLAGS} ${LDFLAGS} -o $@ $<
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement