first commit
This commit is contained in:
45
sciotest/Makefile
Normal file
45
sciotest/Makefile
Normal file
@ -0,0 +1,45 @@
|
||||
BIN := $(shell basename $$(pwd))
|
||||
|
||||
SRCS := $(wildcard *.cpp)
|
||||
OBJS := $(subst .cpp,.o,$(SRCS))
|
||||
DEPS := $(subst .cpp,.d,$(SRCS))
|
||||
|
||||
CXX ?= g++
|
||||
PKG_CONFIG ?= pkg-config
|
||||
|
||||
PREFIX ?= /usr/local
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
DATADIR ?= $(PREFIX)/share
|
||||
MANDIR ?= $(DATADIR)/man
|
||||
|
||||
RM := /bin/rm -f
|
||||
INSTALL := /usr/bin/install -c
|
||||
|
||||
CXXFLAGS := $(CXXFLAGS) -Wshadow -Wall -Wpedantic -Wextra -g -fno-strict-aliasing -std=c++17 -pthread
|
||||
ifeq ($(DEBUG),1)
|
||||
CXXFLAGS += -D DEBUG -O0
|
||||
else
|
||||
CXXFLAGS += -D NDEBUG -O3
|
||||
endif
|
||||
|
||||
LDLIBS := -lm -lpthread -lcommon -lscio
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
$(BIN): $(OBJS) $(DEPS)
|
||||
$(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $(BIN)
|
||||
|
||||
%.o: %.cpp %.d Makefile
|
||||
$(CXX) $(CXXFLAGS) -MMD -MP -MT $@ -MF $*.d -c $<
|
||||
|
||||
-include *.d
|
||||
|
||||
%.d: ;
|
||||
|
||||
.PHONY: clean install
|
||||
|
||||
clean:
|
||||
$(RM) $(OBJS) $(DEPS) $(BIN)
|
||||
|
||||
install: $(BIN)
|
||||
$(INSTALL) $(BIN) $(DESTDIR)$(BINDIR)
|
25
sciotest/main.cpp
Normal file
25
sciotest/main.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// main.cpp
|
||||
// sciotest
|
||||
//
|
||||
// Created by Bob Polis at 2020-02-14
|
||||
// Copyright (c) 2020 SwiftCoder. All rights reserved.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <libcommon.hpp>
|
||||
#include <libscio.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int /*argc*/, const char * argv[]) {
|
||||
try {
|
||||
sc::io::fdostream chan(1);
|
||||
chan << "hello, sciotest\n";
|
||||
} catch (const exception& ex) {
|
||||
cerr << su::basename(argv[0]) << ": " << ex.what() << '\n';
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Reference in New Issue
Block a user