Skip to content

Commit

Permalink
Update Makefile, build script
Browse files Browse the repository at this point in the history
  • Loading branch information
nickolasburr committed Sep 14, 2017
1 parent 4c10f27 commit f866108
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
8 changes: 5 additions & 3 deletions Makefile
Expand Up @@ -27,7 +27,7 @@ LG2_INC = $(LG2_DIR)/include

KERNEL := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')

CFLAGS = -ggdb -I$(INCLUDE) -I$(LG2_INC) -Wall -Wextra
CFLAGS = -I$(INCLUDE) -I$(LG2_INC)
LDFLAGS = -pthread -lssl -lcrypto -lz

ifeq "$(KERNEL)" "Darwin"
Expand All @@ -36,12 +36,14 @@ endif

.PHONY: all build clean install uninstall

all: build $(TARGET)
all: $(TARGET)

build:
@cd $(TOOLS) && ./build.sh

$(TARGET): $(CSFILES)
$(LG2_ARC): build

$(TARGET): $(CSFILES) $(LG2_ARC)
$(CC) $(CFLAGS) -o $@ $^ $(LG2_ARC) $(LDFLAGS)

clean:
Expand Down
18 changes: 10 additions & 8 deletions tools/build.sh
Expand Up @@ -22,14 +22,16 @@ fi

cd $LG2_BUILD_DIR &&

cmake -DTHREADSAFE=ON \
-DBUILD_CLAR=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DUSE_SSH=OFF \
-DCURL=OFF \
-DCMAKE_C_FLAGS=-fPIC \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
cmake -DTHREADSAFE=ON \
-DBUILD_CLAR=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DUSE_SSH=OFF \
-DCURL=OFF \
-DCMAKE_C_FLAGS=-fPIC \
-DCMAKE_C_ARCHIVE_CREATE="<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>" \
-DCMAKE_C_ARCHIVE_FINISH="<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>" \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR" \
.. &&

cmake --build .

0 comments on commit f866108

Please sign in to comment.