added Makefile
git-svn-id: svn://anubis/anaglym/trunk@3 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
06c988a2c2
commit
6a3d938e75
36
Makefile
Normal file
36
Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
TARGET := anaglym
|
||||
COBJS := $(patsubst %.c,%.o,$(wildcard *.c))
|
||||
CXXOBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
|
||||
OBJS := $(COBJS) $(CXXOBJS)
|
||||
CDEPS := $(COBJS:.o=.dep)
|
||||
CXXDEPS := $(CXXOBJS:.o=.dep)
|
||||
DEPS := $(CDEPS) $(CXXDEPS)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS) wfobj/WFObj.o
|
||||
$(CXX) -o $@ $^
|
||||
|
||||
wfobj/WFObj.o:
|
||||
$(MAKE) -C wfobj
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
|
||||
|
||||
%.o: %.cc
|
||||
$(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) $<
|
||||
|
||||
# Make dependency files
|
||||
%.dep: %.c
|
||||
@set -e; rm -f $@; \
|
||||
$(CC) -MM $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
|
||||
|
||||
%.dep: %.cc
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
|
||||
|
||||
clean:
|
||||
-rm -f *.o *.dep *~
|
||||
|
||||
-include $(DEPS)
|
Loading…
x
Reference in New Issue
Block a user