Created
January 9, 2011 13:52
-
-
Save antmd/771700 to your computer and use it in GitHub Desktop.
Example makefile for building Objective-C and Objective-C++ command-line tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all:commonprefix | |
clean: | |
rm *.o urlchanger | |
CC=clang | |
CFLAGS+=-O0 -g | |
CXXFLAGS+=-O0 -g | |
#LDFLAGS+=-macosx_version_min 10.6 | |
urlchanger:urlchanger.o | |
$(CC) $< $(LDFLAGS) -F/System/Library/Frameworks -framework Foundation -o $@ | |
fileattributes:fileattributes.o | |
$(CC) $< $(LDFLAGS) -F/System/Library/Frameworks -framework Foundation -framework AppKit -o $@ | |
commonprefix:commonprefix.mm.o | |
$(CC) $< $(LDFLAGS) -ObjC++ -stdlib=libstdc++ -F/System/Library/Frameworks -framework Foundation -framework AppKit -o $@ -lstdc++ | |
############################################################ | |
#################### | |
# Rules | |
############################################################ | |
#################### | |
%.c.o : %.c $(C_DEPS) | |
$(VERBOSE)$(CC) $(CFLAGS) -o $@ -c $< | |
%.cpp.o : %.cpp $(C_DEPS) | |
$(VERBOSE)$(CXX) $(CXXFLAGS) -o $@ -c $< | |
%.m.o : %.m $(C_DEPS) | |
$(VERBOSE)$(CXX) $(CFLAGS) -o $@ -c $< | |
%.mm.o : %.mm $(C_DEPS) | |
$(VERBOSE)$(CXX) $(CXXFLAGS) -o $@ -c $< | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment