Fixed build system for OS X builds.

This commit is contained in:
Pietro Gagliardi 2015-04-28 14:46:09 -04:00
parent 440949a60a
commit 0e16aa4d7c
5 changed files with 13 additions and 1 deletions

View File

@ -35,6 +35,9 @@ $(OUT): $(OFILES) | $(OUTDIR)/.phony
$(OBJDIR)/%.o: %.c $(xHFILES) | $$(dir $$@).phony
$(CC) -o $@ -c $< $(xCFLAGS)
$(OBJDIR)/%.o: %.m $(xHFILES) | $$(dir $$@).phony
$(CC) -o $@ -c $< $(xCFLAGS)
# see http://www.cmcrossroads.com/article/making-directories-gnu-make
%/.phony:
mkdir -p $(dir $@)

View File

@ -31,7 +31,7 @@ baseMFILES = $(osMFILES)
baseCFLAGS = $(osCFLAGS)
baseLDFLAGS = \
-shared \
-Wl,--no-undefined -Wl,--no-allow-shlib-undefined \
$(osLDWarnUndefinedFlags) \
$(osLDFLAGS)
baseSUFFIX = $(osLIBSUFFIX)

View File

@ -14,5 +14,10 @@ osHFILES = \
osCFLAGS = -mmacosx-version-min=10.7 -DMACOSX_DEPLOYMENT_TARGET=10.7
osLDFLAGS = -mmacosx-version-min=10.7 -lobjc -framework Foundation -framework AppKit
# the gcc flags don't work with Apple's linker
# fortunately, we don't need any; Apple's linker warns about undefined symbols in -shared builds!
osLDWarnUndefinedFlags =
osLIBSUFFIX = .dylib
osEXESUFFIX =

View File

@ -25,5 +25,7 @@ osLDFLAGS = \
-fPIC \
`pkg-config --libs gtk+-3.0`
osLDWarnUndefinedFlags = -Wl,--no-undefined -Wl,--no-allow-shlib-undefined
osLIBSUFFIX = .so
osEXESUFFIX =

View File

@ -24,6 +24,8 @@ osLDFLAGS = \
-static-libgcc \
-luser32 -lkernel32 -lgdi32 -luxtheme -lmsimg32 -lcomdlg32 -lole32 -loleaut32 -loleacc -luuid
osLDWarnUndefinedFlags = -Wl,--no-undefined -Wl,--no-allow-shlib-undefined
osLIBSUFFIX = .dll
osEXESUFFIX = .exe