added tmpl.{cc,h} build rules
This commit is contained in:
parent
3a8d9ca55d
commit
07717ec5ba
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ tags
|
||||
*.o
|
||||
.*.swp
|
||||
*.dep
|
||||
tmpl.*
|
||||
|
16
Makefile
16
Makefile
@ -1,6 +1,6 @@
|
||||
|
||||
TARGET := imbecile
|
||||
CXXOBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
|
||||
CXXOBJS := $(patsubst %.cc,%.o,$(wildcard *.cc)) tmpl.o
|
||||
CXXDEPS := $(patsubst %.o,.%.dep,$(CXXOBJS))
|
||||
CXXFLAGS := -O2
|
||||
DEPS := $(CXXDEPS)
|
||||
@ -34,7 +34,19 @@ $(TARGET): $(OBJS)
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(CPPFLAGS) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
|
||||
|
||||
tmpl.cc: $(wildcard tmpl/*)
|
||||
echo -n > $@
|
||||
for f in $*/*; \
|
||||
do xxd -i $$f >> $@; \
|
||||
done
|
||||
|
||||
tmpl.h: tmpl.cc
|
||||
echo '#ifndef $*_h' > $@
|
||||
echo '#define $*_h' >> $@
|
||||
grep '$*_' $^ | sed -e 's/^/extern /' -e 's/ =.*/;/' >> $@
|
||||
echo '#endif' >> $@
|
||||
|
||||
clean:
|
||||
-rm -f $(TARGET) *.o .*.dep
|
||||
-rm -f $(TARGET) *.o .*.dep tmpl.cc tmpl.h
|
||||
|
||||
-include $(CXXDEPS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user