Makefile 1.29 KB
Newer Older
1
2
3
4
TARGETS=client server
LABCOMM_JAR=../../compiler/labComm.jar
LABCOMM=java -jar $(LABCOMM_JAR) 

5
CFLAGS=-O3 -g -Wall -Werror -I../../lib/c -I. -Wno-unused-function
6
7
8

all: $(TARGETS:%=gen/%)

9
10
11
12
test: all
	LD_LIBRARY_PATH=../../lib/c ./gen/server 2000 &
	LD_LIBRARY_PATH=../../lib/c ./gen/client localhost 2000 

13
14
15
16
17
18
19
20
21
22
23
24
25
26
gen/.dir:
	mkdir -p $@

.PRECIOUS: gen/%.o
gen/%.o: gen/%.c | gen/.dir
	$(CC) $(CFLAGS) -c -o $@ $< 

gen/%.o: %.c | gen/.dir
	$(CC) $(CFLAGS) -c -o $@ $< 

.PRECIOUS: gen/%.c gen/%.h
gen/%.c gen/%.h: %.lc | gen/.dir
	$(LABCOMM) --c=gen/$*.c --h=gen/$*.h $<

27
28
gen/client: client.c 
	$(CC) -o $@ $(CFLAGS) $^ -lpthread \
29
		-L../../lib/c -llabcomm 
30

31
gen/server: server.c 
32
	$(CC) -o $@ $(CFLAGS) $^ -lpthread \
33
		-L../../lib/c -llabcomm 
34
35
36
37
38
39
40

.PHONY: clean
clean:
	rm -rf gen

gen/decimating.o: decimating.h
gen/decimating.o: gen/decimating_messages.h
41
42
gen/introspecting.o: introspecting.h
gen/introspecting.o: gen/introspecting_messages.h
43
44
gen/client.o: decimating.h
gen/client.o: gen/types.h
45
gen/client: gen/decimating.o 
46
gen/client: gen/decimating_messages.o
47
48
gen/client: gen/introspecting.o
gen/client: gen/introspecting_messages.o
49
gen/client: gen/types.o
50
51
gen/server: gen/types.o
gen/server: gen/decimating.o
52
gen/server: gen/decimating_messages.o
53
54
gen/server: gen/introspecting.o
gen/server: gen/introspecting_messages.o