Skip to content

Commit

Permalink
adding *nix makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
DBHeise committed Apr 16, 2020
1 parent 117c591 commit e73d818
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#~/user/bin/make -f
EXECUTABLE = showsheets
SO_LIBRARY = showsheets.so

CC = gcc
CXX = g++
CFLAGS = -fPIC -Wno-enum-conversion -O3
CXXFLAGS = -fPIC -std=c++11 -O3 -Wfatal-errors -Werror
LDFLAGS = -pthread

SRC_SHOWSHEETS = \
src/showsheets.cpp \
src/pole.cpp


# Object files
OBJS = \
$(SRC_SHOWSHEETS:.cpp=.o)

# Rules
all: $(EXECUTABLE) $(SO_LIBRARY)

$(EXECUTABLE): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(CPP_FILES) -o $@ $^

$(SO_LIBRARY): $(OBJS)
$(CXX) $(LDFLAGS) -shared -o $@ $^

%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

clean:
rm -rf `find Source -name '*.o'` $(EXECUTABLE) $(SO_LIBRARY)


BINDIR ?= ${PREFIX}/bin

install:
@cp -p bin/showsheets ${PREFIX}/showsheets

0 comments on commit e73d818

Please sign in to comment.