-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.shared
33 lines (27 loc) · 1.02 KB
/
Makefile.shared
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
ifndef FULLPATH
fpath =
else
fpath = $(CURDIR)/
endif
.objects-$(ARCH)/%.o: %.cpp
@mkdir -p .objects-$(ARCH)
@echo Compiling $<
$(CXX) -c $(CXXFLAGS) $(fpath)$< -o $@
INCLUDES = $(filter -I%, $(CXXFLAGS))
DEFINES = $(filter -D%, $(CXXFLAGS))
FASTDEP = $(shell /bin/ls /usr/bin/fastdep 2>/dev/null)
ifeq ($(ARCH_SYSX), centos4)
# fastdep segfault for unknown reasons for most of the files
FASTDEP = disabled
endif
ifeq ($(FASTDEP), /usr/bin/fastdep)
.depend-$(ARCH)/%.d: %.cpp
@echo Creating dependencies for $<
$(SHELL) -ec 'mkdir -p .depend-$(ARCH); $(FASTDEP) $(INCLUDES) $(DEFINES) $< | sed -e '\''s#\($*\)\.o[ :]*#.objects-$(ARCH)/\1.o $@ : #g'\'' -e '\''s#$(MC2DIR)#$$(MC2DIR)#g'\'' > $@; [ -s $@ ] || rm -f $@'
else
.depend-$(ARCH)/%.d: %.cpp
@echo Creating dependencies for $<
$(SHELL) -ec 'mkdir -p .depend-$(ARCH); $(CXX) -MM $(INCLUDES) $(DEFINES) $< -MT .objects-$(ARCH)/$*.o | sed -e '\''s#$(MC2DIR)#$$(MC2DIR)#g'\'' > $@; [ -s $@ ] || rm -f $@'
endif
%.class: %.java
$(JAVAC) $(JAVACFLAGS) $(shell echo *.java)