1EXE                 = coopmads.exe
2COMPILATOR = mpic++
3SUNAME = $(shell uname)
4OSS=$(findstring MINGW32,$(SUNAME))
5ifneq "$(strip $(OSS))" ""
6COMPILATOR = g++
7endif
8
9COMPILATOR_OPTIONS  = -ansi -O2
10L1                  = $(NOMAD_HOME)/lib/nomad.a
11LIBS                = $(L1) -lm -lmpi
12INCLUDE             = -I$(NOMAD_HOME)/src -I.
13COMPILE             = $(COMPILATOR) $(COMPILATOR_OPTIONS) $(INCLUDE) -c
14OBJS                = main.o Cache_Server.o
15
16ifndef NOMAD_HOME
17define ECHO_NOMAD
18	@echo Please set NOMAD_HOME environment variable!
19	@false
20endef
21endif
22
23$(EXE): $(OBJS) $(L1)
24	$(ECHO_NOMAD)
25	$(COMPILATOR) -o $(EXE) $(OBJS) $(LIBS) $(COMPILATOR_OPTIONS)
26
27main.o: main.cpp
28	$(COMPILE) main.cpp
29
30Cache_Server.o: Cache_Server.cpp Cache_Server.hpp
31	$(ECHO_NOMAD)
32	$(COMPILE) Cache_Server.cpp
33
34$(L1): ;
35	$(ECHO_NOMAD)
36
37clean:
38	@echo "cleaning obj files"
39	@rm -f $(OBJS)
40
41del:
42	@echo "cleaning trash files"
43	@rm -f core *~
44	@echo "cleaning obj files"
45	@rm -f $(OBJS)
46	@echo "cleaning exe file"
47	@rm -f $(EXE)
48