Skip to content

Commit 94181e5

Browse files
committed
Add boilerplate.
1 parent 77939ad commit 94181e5

28 files changed

+59
-58
lines changed

Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ CFLAGS_EXTRA := -Wno-overflow -Wno-sequence-point -Wno-unused-variable -Wno-unus
22
CXXFLAGS_EXTRA := -Wno-sequence-point -Wno-unused-variable -Wno-unused-but-set-variable -pthread
33
FFLAGS_EXTRA := -Wno-unused-variable -Wno-unused-but-set-variable
44
RUN := c
5-
PHONY := install-ubuntu

Makefile_targets

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
install-ubuntu:
2-
sudo apt-get update
3-
sudo apt-get install aptitude
4-
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
1+
deps:
52
sudo aptitude update
3+
sudo aptitude install build-essential
4+
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
65
# C
76
sudo aptitude install -y gcc-4.8
87
sudo aptitude install -y gcc-4.8-doc
@@ -12,3 +11,5 @@ install-ubuntu:
1211
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
1312
# Fortran
1413
sudo aptitude install -y gfortran
14+
15+
sudo aptitude install -y g++

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Based on Linux tools, but portable code is clearly separated from non-portable.
1414

1515
To compile and run each directory on Ubuntu 12.04 do:
1616

17-
make install-ubuntu
17+
make deps
1818
make run
1919

20-
You *must* run `make install-ubuntu` on the top-level before compiling any subdirectories, as this will install basic tools such as recent enough `gcc` and `g++` for C11 and C++11.
20+
You *must* run `make deps` on the top-level before compiling any subdirectories, as this will install basic tools such as recent enough `gcc` and `g++` for C11 and C++11.
2121

2222
When there are multiple files compiled, e.g.:
2323

Vagrantfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
boilerplate/Vagrantfile

Vagrantfile_local.rb.example

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is gitignored.
2+
3+
Box = "precise32"
4+
BoxUrl = "http://files.vagrantup.com/precise32.box"
5+
6+
#Box = "debian-7.2.0"
7+
#BoxUrl = "https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box"

boost/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LIBS := -lboost_graph -lm
2-
PHONY := install-ubuntu

boost/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
sudo aptitude install -y libboost1.48-all-dev

gsl/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LIBS := -lgsl -lgslcblas -lm -lplplotd
2-
PHONY := install-ubuntu

gsl/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
# gsl
44
sudo aptitude install -y libgsl0-dev gsl-doc-info

gtk/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ PKGNAME := gtk+-3.0
22
CFLAGS := $(shell pkg-config --cflags "$(PKGNAME)")
33
LIBS := $(shell pkg-config --libs "$(PKGNAME)")
44
RUN := min
5-
PHONY := install-ubuntu

gtk/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
sudo aptitude install -y libgtk-3-dev

kde/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ clean:
1313
install: all
1414
cd "$(BUILD_DIR)" && make install
1515

16-
install-ubuntu:
16+
deps:
1717
sudo aptitude install -y kdelibs5-dev
1818

1919
run: all

lapack/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
LIBS := -lm -lblas -llapacke
22
FFLIBS := -l:libblas/libblas.so -l:lapack/liblapack.so
3-
PHONY := install-ubuntu

lapack/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
# BLAS C/Fotran and LAPACK Fortran:
44
sudo aptitude install -y liblapack-dev

ode/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LIBS := -lode
2-
PHONY := install-ubuntu

ode/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
sudo aptitude install -y libode-dev

opencv/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ $(OUT_DIR)%$(OUT_EXT): $(IN_DIR)%$(IN_EXT)
3535
clean:
3636
rm -rf $(OUT_DIR) $(AUX_DIR)
3737

38-
install-ubuntu:
38+
deps:
3939
sudo apt-get install -y libopencv-dev opencv-doc

opencv/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LIBS := -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -lm
2-
PHONY := install-ubuntu

opencv/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
sudo aptitude install -y libopencv-dev

opengl/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LIBS := -lm -pthread -lGL -lGLU -lglut
2-
PHONY := install-ubuntu

opengl/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
install-ubuntu:
1+
deps:
22
sudo apt-get install -y freeglut3-dev

opengl/texture_fps/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ mkdir:
2828
clean:
2929
rm -rf $(OUT_DIR) $(SAUX_DIR)
3030

31-
install-ubuntu:
31+
deps:
3232
sudo apt-get install freeglut-dev
3333
sudo apt-get install libopencv-dev

plplot/Makefile_params

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
LIBS := -lm -lplplotd
2-
PHONY := install-ubuntu

plplot/Makefile_targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
install-ubuntu:
1+
deps:
22
sudo aptitude update
33
sudo aptitude install -y libplplot-dev
44
sudo aptitude install -y plplot11-driver-xwin

qt/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ install: all
2121
install-run:
2222
$(TARGET)
2323

24-
install-ubuntu:
24+
deps:
2525
sudo aptitude update
2626
sudo aptitude install -y libqt4-dev
2727

test

-30
This file was deleted.

test

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test_many

test_many

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
Run executables with filenames given in argv[2:] and inside directory argv[1].
5+
Stop on the first that returns non 0 status.
6+
"""
7+
8+
import os
9+
import subprocess
10+
import sys
11+
12+
out_dir = sys.argv[1]
13+
out_files = sys.argv[2:]
14+
15+
os.chdir(out_dir)
16+
# TODO make tac work.
17+
for out_file in [ x for x in out_files if not x in ['tac']]:
18+
process = subprocess.Popen(
19+
['./' + out_file],
20+
shell = False,
21+
stdin = subprocess.PIPE,
22+
stdout = subprocess.PIPE,
23+
stderr = subprocess.PIPE,
24+
universal_newlines = True
25+
)
26+
exit_status = process.wait()
27+
if exit_status != 0:
28+
print "Test failed for file: " + out_file
29+
sys.exit(1)
30+
print "All tests passed."

0 commit comments

Comments
 (0)