Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/java/Makefile
blob: 6465048c289986e3c496b54d6c4f23594fadd05c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

WARNFLAGS = \
        -W -Wformat -Wall -Wundef -Wpointer-arith -Wcast-qual \
        -Wcast-align -Wwrite-strings -Wsign-compare \
        -Wmissing-noreturn \
        -Wextra -Wstrict-aliasing=2 \
        -Wunsafe-loop-optimizations \
		-Wuninitialized

# Compiler flags for generating dependencies
DEPFLAGS = -MMD -MP
CFLAGS ?= -O3
# CFLAGS ?= -O0 -g
# LDFLAGS ?= -g
ALLCFLAGS = -std=gnu99 -fPIC $(WARNFLAGS) $(DEPFLAGS) $(CFLAGS)

# declarations

RAINBOW_JAVA_OBJS = rainbow-java.o
ALL_OBJS = $(RAINBOW_JAVA_OBJS)
BINARIES = rainbow-java

SH_PATH=$(LIBDIR)/rainbow-java.sh
FULL_PATH=\"$(SH_PATH)\"

# if you invoke make as 'make V=1' it will verbosely report on what it
# is doing, otherwise it defaults to quiet/pretty mode, which makes
# errors _much_ easier to see
ifneq ($V, 1)
MAKEFLAGS = -s
endif


# targets

all: $(BINARIES)

clean:
	rm -f $(BINARIES) *.d *.o

install:
	install -D -m 0755 rainbow-java.sh $(SH_PATH)
	install -D -m 6755 rainbow-java $(BINDIR)/rainbow-java

# objects

%.o: %.c
	@echo "  CC    $@"
	$(CC) $(ALLCFLAGS) -c -o $@ $< -DFULL_PATH=$(FULL_PATH)


# linked binaries

rainbow-java: $(RAINBOW_JAVA_OBJS)
	@echo "  LD    $@"
	$(CC) $(ALLCFLAGS) -o $@ $^


.PHONY: clean install

-include $(ALL_OBJS:%.o=%.d)

# vim: noet sts=4 ts=4 sw=4 :