Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Add Makefile lmctfy-creaper rules and small fix
Browse files Browse the repository at this point in the history
Added rules to Makefile to build and install lmctfy-creaper.
Also make install now first builds everything.
  • Loading branch information
kyurtsever committed Mar 27, 2014
1 parent 6f7714e commit b5df1e3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ CLI = lmctfy
NSCON = lmctfy-nscon
NSINIT = lmctfy-nsinit
LIBRARY = liblmctfy.a
CREAPER = lmctfy-creaper

# Function for ensuring the output directory has been created.
create_bin = mkdir -p $(dir $(OUT_DIR)/$@)
Expand All @@ -116,15 +117,17 @@ source_to_object = $(addsuffix .o,$(basename $(1)))

default: all

all: $(LIBRARY) $(NSINIT) $(NSCON) $(CLI)
all: $(LIBRARY) $(NSINIT) $(NSCON) $(CLI) $(CREAPER)

install:
install: all
cp ./bin/lmctfy/cli/$(CLI) /usr/local/bin
chmod +x /usr/local/bin/$(CLI)
cp ./bin/nscon/cli/$(NSCON) /usr/local/bin
chmod +x /usr/local/bin/$(NSCON)
cp ./bin/nscon/$(NSINIT) /usr/local/bin
chmod +x /usr/local/bin/$(NSINIT)
cp ./bin/$(CREAPER) /usr/local/bin
chmod +x /usr/local/bin/$(CREAPER)

TEST_TMPDIR = "/tmp/lmctfy_test.$$"
check: $(TESTS)
Expand Down Expand Up @@ -192,6 +195,10 @@ $(NSINIT): nsinit_cli.a
$(create_bin)
$(CXX) -o $(OUT_DIR)/nscon/$@ $(addprefix $(OUT_DIR)/,$^) $(CXXFLAGS)

$(CREAPER): lmctfy-creaper.go
$(create_bin)
go build -o $(OUT_DIR)/lmctfy-creaper lmctfy-creaper.go

%_test: gtest_main.a $(SYSTEM_API_TEST_OBJS) nscon_cli.a lmctfy_cli.a lmctfy_no_system_api.a
$(create_bin)
$(CXX) -o $(OUT_DIR)/$@ $*.cc $*_test.cc $(addprefix $(OUT_DIR)/,$^) \
Expand Down

0 comments on commit b5df1e3

Please sign in to comment.