Merge pull request #9 from colindean/cleanup

Moves some vars in the Makefile
This commit is contained in:
Colin Dean 2018-04-08 12:48:45 -04:00 committed by GitHub
commit 7b80324f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 5 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
*.o
golay
golay_codes.c
optar
unoptar

View File

@ -1,5 +1,15 @@
language: c
compiler:
- clang
- gcc
script: "make"
- clang
- gcc
script: make -j
before_deploy: make -j archive
deploy:
provider: releases
api_key:
secure: mz4/p8VB7qn6F3M8uPT2/mJmU/nEWRGgsxN+KM/Gg1isSVrRpWP0xYfPTOdU6o9f0IVBRIW7SjHuq1H9kqGhmWx+Aycs8gE905ORYidLRjbkPN/fiS2jL6CcRzolkprvK7btIRhxfFGB/y3L0MELh+kXo1A6oIm+2a+OwNpdi4c=
file: optar-*.tar.gz
file_glob: true
on:
repo: colindean/optar
tags: true

View File

@ -10,6 +10,11 @@ CFLAGS=-O3 -Wall -Wuninitialized \
$(SPECIFIC_CFLAGS) \
-DNODEBUG `libpng-config --I_opts`
VERSION=$(shell git describe)
ARCHIVE_PATH=optar-$(VERSION).tar.gz
BINARIES=optar unoptar
EXECUTABLES=$(BINARIES) pgm2ps
all: optar unoptar
install:
@ -23,7 +28,7 @@ uninstall:
rm /usr/local/bin/pgm2ps
clean:
rm -f optar unoptar golay golay_codes.c *.o
rm -f $(BINARIES) optar-*.tar.gz golay_codes.c *.o
common.o: common.c optar.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
@ -41,7 +46,7 @@ golay.o: golay.c parity.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
unoptar.o: unoptar.c optar.h parity.h
$(CC) -c -I/usr/local/include/libpng $(CPPFLAGS) $(CFLAGS) -o $@ $<
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
optar: optar.o common.o golay_codes.o parity.o
$(CC) $(LDFLAGS) -o $@ $^
@ -54,3 +59,8 @@ golay: golay.o parity.o
unoptar: unoptar.o common.o golay_codes.o parity.o
$(CC) -o $@ -L/usr/local/lib $^ -lm -lpng -lz
archive: $(ARCHIVE_PATH)
$(ARCHIVE_PATH): $(EXECUTABLES)
tar czvf $@ $^