Permalink
Browse files

makefile hax

  • Loading branch information...
1 parent a45cbfb commit d2b6a96d495cb83acc8962317cab912b6467c67e @comex committed Mar 29, 2011
Showing with 10 additions and 4 deletions.
  1. +3 −3 Makefile
  2. +6 −1 Makefile.common
  3. +1 −0 data
View
@@ -1,15 +1,15 @@
include Makefile.common
-all: libdata.a libdata.$(DYLIB)
+all: .settings libdata.a libdata.$(DYLIB)
%.o: %.c *.h
$(GCC) $(CFLAGS) -c -o $@ $< -Wreturn-type
OBJS := common.o binary.o running_kernel.o link.o find.o cc.o lzss.o
libdata.a: $(OBJS)
rm -f $@
- $(AR) rcs $@ $^
+ $(AR) rcs $@ $(OBJS)
libdata.$(DYLIB): $(OBJS)
- $(GCC) $(DYNAMICLIB) -o $@ $^
+ $(GCC) $(DYNAMICLIB) -o $@ $(OBJS)
clean:
rm -f *.o libdata.a
View
@@ -1,3 +1,5 @@
+NATIVE ?= 0
+
DYNAMICLIB := -dynamiclib
DYLIB := dylib
ifeq "$(NATIVE)" "1"
@@ -8,7 +10,7 @@ else
GCC ?= gcc -arch i386 -arch x86_64
endif
else
-GCC ?= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/ -mapcs-frame -fomit-frame-pointer -mthumb -fno-builtin-printf -fno-builtin-memset
+GCC ?= /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/ -mapcs-frame -fomit-frame-pointer -mthumb -fno-builtin-printf -fno-builtin-memset
endif
CFLAGS ?= -g3 -std=gnu99 -Os -Wall -Wextra -Wno-parentheses -Werror
@@ -17,3 +19,6 @@ CFLAGS += -DIMG3_SUPPORT -dead_strip
endif
AR ?= ar
+SETTINGS = $(NATIVE) $(GCC) $(CFLAGS)
+.settings:
+ @if [ "`cat .settings0 2>/dev/null`" != "$(SETTINGS)" ]; then echo "$(SETTINGS)" > .settings0; make clean; fi
View
1 data

0 comments on commit d2b6a96

Please sign in to comment.