aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-02-08 06:31:13 +0100
committerMattias Andrée <maandree@operamail.com>2013-02-08 06:31:13 +0100
commit7ad82d0366a352055316c0e2de22dc9abdd292a4 (patch)
tree5c5b967487e8d9a157b5c29feee898cf302472ff /Makefile
parentm (diff)
downloadsha3sum-7ad82d0366a352055316c0e2de22dc9abdd292a4.tar.gz
sha3sum-7ad82d0366a352055316c0e2de22dc9abdd292a4.tar.bz2
sha3sum-7ad82d0366a352055316c0e2de22dc9abdd292a4.tar.xz
corrected
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 21 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 50208d9..f3068b0 100644
--- a/Makefile
+++ b/Makefile
@@ -8,20 +8,36 @@
# [GNU All Permissive License]
JAVAC=javac
+JAVADIRS=-s "pure-java" -d "bin/pure-java" -cp "pure-java"
+JAVAFLAGS=-Xlint
+JAVA_FLAGS=$(JAVADIRS) $(JAVAFLAGS)
+CFLAGS=-W{all,extra} -pedantic
+CPPFLAGS=
+LDFLAGS=
+C_FLAGS=$(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
-JAVA_CLASSES = $(shell find "pure-java" | grep '\.java$$' | sed -e 's_^_bin/_g' -e 's_java$$_class_g')
+JAVA_CLASSES = $(shell find "pure-java" | grep '\.java$$' | sed -e 's_^_bin/_g' -e 's_java$$_class_g')
+C_OBJS = $(shell find "c" | grep '\.h$$' | sed -e 's_^_bin/_g' -e 's_h$$_o_g')
+C_BINS = bin/c/sha3sum
-all: pure-java
+all: pure-java c
pure-java: $(JAVA_CLASSES)
bin/pure-java/%.class: pure-java/%.java
mkdir -p "bin/pure-java"
- $(JAVAC) -s "pure-java" -d "bin/pure-java" -cp "pure-java" "pure-java/$*.java"
-
-
+ $(JAVAC) $(JAVA_FLAGS) "pure-java/$*.java"
+
+c: $(C_OBJS) $(C_BINS)
+bin/c/%.o: c/%.h c/%.c
+ mkdir -p "bin/c"
+ $(CC) $(C_FLAGS) -c "c/$*".{c,h}
+ mv "$*.o" "c/$*.o"
+bin/c/%: c/%.c
+ mkdir -p "bin/c"
+ $(CC) $(C_FLAGS) -o "$@" "c/$*".c "c/"*.o
.PHONY: clean