Skip to content

Instantly share code, notes, and snippets.

@neojou
Last active January 1, 2016 12:49
Show Gist options
  • Save neojou/8147138 to your computer and use it in GitHub Desktop.
Save neojou/8147138 to your computer and use it in GitHub Desktop.
Makefile example
CC = gcc
CFLAGS = -Wall -Werror -fconstant-string-class=NSConstantString -D_NATIVE_OBJC_EXCEPTIONS
INCDIR = -I `gnustep-config --variable=GNUSTEP_SYSTEM_HEADERS`
LIBDIR = -L `gnustep-config --variable=GNUSTEP_SYSTEM_LIBRARIES`
OBJS = helloworld.o
LIBS = -lobjc -lgnustep-base
.SUFFIXS: .c .cpp .m
helloworld: ${OBJS}
${CC} ${OBJS} ${LDFLAGS} ${LIBS} -o $@
%.o: %.m
${CC} $< ${CFLAGS} ${INCDIR} ${LIBDIR} -c
.PHONY: clean
clean:
@rm -rf *.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment