git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: clean up Makefile and psc-xcode.sh
d0feb35Andy Arvanitis
pcc/Makefile−12
@@ -21,7 +21,6 @@ PURESCRIPT_PKGS := .psc-package
21PURESCRIPT_SRC := src
21PURESCRIPT_SRC := src
22OUTPUT := output
22OUTPUT := output
23BIN := main
23BIN := main
24−OBJ := purescript.o
25
24
26override PCCFLAGS += --comments
25override PCCFLAGS += --comments
27override CXXFLAGS += -std=c++11
26override CXXFLAGS += -std=c++11
@@ -48,12 +47,6 @@ release: codegen
48debug: codegen
47debug: codegen
49 @$(MAKE) $(BIN) CXXFLAGS+=$(DEBUG)
48 @$(MAKE) $(BIN) CXXFLAGS+=$(DEBUG)
50
49
51−release-object: codegen
52− @$(MAKE) $(OBJ) CXXFLAGS+=$(RELEASE)
53−
54−debug-object: codegen
55− @$(MAKE) $(OBJ) CXXFLAGS+=$(DEBUG)
56−
57codegen: PURESCRIPT_PKG_SRCS=$(shell find $(PURESCRIPT_PKGS) -name '*.purs' | grep -v \/test\/ | grep -v \/example\/ | grep -v \/examples\/)
50codegen: PURESCRIPT_PKG_SRCS=$(shell find $(PURESCRIPT_PKGS) -name '*.purs' | grep -v \/test\/ | grep -v \/example\/ | grep -v \/examples\/)
58codegen: PURESCRIPT_SRCS=$(shell find $(PURESCRIPT_SRC) -name '*.purs')
51codegen: PURESCRIPT_SRCS=$(shell find $(PURESCRIPT_SRC) -name '*.purs')
59#
52#
@@ -74,11 +67,6 @@ $(BIN): $(OBJS)
74 @mkdir -p $(BIN_DIR)
67 @mkdir -p $(BIN_DIR)
75 @$(CXX) $^ -o $(BIN_DIR)/$@ $(LDFLAGS)
68 @$(CXX) $^ -o $(BIN_DIR)/$@ $(LDFLAGS)
76
69
77−$(OBJ): $(OBJS)
78− @echo "Creating combined object file" $(BIN_DIR)/$(OBJ)
79− @mkdir -p $(BIN_DIR)
80− @$(LD) -r $^ -o $(BIN_DIR)/$@ $(LDFLAGS)
81−
82-include $(DEPS)
70-include $(DEPS)
83
71
84%.o: %.cc
72%.o: %.cc
pcc/psc-xcode.sh+3−3
@@ -14,14 +14,14 @@ if [[ "$CONFIGURATION" == "Debug" ]] ; then
14 touch "$IS_DEBUG"
14 touch "$IS_DEBUG"
15 fi
15 fi
16 rm "$IS_RELEASE" > /dev/null 2>&1 || true
16 rm "$IS_RELEASE" > /dev/null 2>&1 || true
17− OBJECT_TYPE=debug-object
17+ OBJECT_TYPE=debug
18else
18else
19 if [ ! -f "$IS_RELEASE" ] ; then
19 if [ ! -f "$IS_RELEASE" ] ; then
20 make clean
20 make clean
21 touch "$IS_RELEASE"
21 touch "$IS_RELEASE"
22 fi
22 fi
23 rm "$IS_DEBUG" > /dev/null 2>&1 || true
23 rm "$IS_DEBUG" > /dev/null 2>&1 || true
24− OBJECT_TYPE=release-object
24+ OBJECT_TYPE=release
25fi
25fi
26
26
27## Create compiler switches for architectures
27## Create compiler switches for architectures
@@ -39,4 +39,4 @@ for arch_ in $ARCHS ; do
39 fi
39 fi
40done
40done
41
41
42−make $OBJECT_TYPE ${PSC_PKG} CXXFLAGS="$ARCH_OPTS $FLTO -isysroot $SDKROOT" LD="clang -Wl,-r -nostdlib $ARCH_OPTS" -j`sysctl -n hw.ncpu`
42+make $OBJECT_TYPE CXXFLAGS="$ARCH_OPTS $FLTO -isysroot $SDKROOT" LDFLAGS="-r -nostdlib $ARCH_OPTS" BIN=purescript.o -j`sysctl -n hw.ncpu`