| 1 | ### Hey, Emacs, ride the -*- Makefile -*- mode |
| 2 | |
| 3 | ## Author: [email protected] |
| 4 | ## Keywords: |
| 5 | |
| 6 | ## definitions |
| 7 | |
| 8 | CXX = g++ |
| 9 | LD = g++ |
| 10 | LIBS = -lsword |
| 11 | LDFLAGS = $(LIBS) |
| 12 | CXXFLAGS = -I/usr/include/sword |
| 13 | |
| 14 | target = mod2tex |
| 15 | objects = mod2tex.o |
| 16 | |
| 17 | ## static rules |
| 18 | |
| 19 | .PHONY : all |
| 20 | |
| 21 | all : $(target) |
| 22 | |
| 23 | $(target) : $(objects) |
| 24 | $(LD) -o $@ $< $(LDFLAGS) |
| 25 | |
| 26 | $(objects) : %.o: %.cpp |
| 27 | $(CXX) -c $(CXXFLAGS) -o $@ $< |
| 28 | |
| 29 | .PHONY : clean |
| 30 | |
| 31 | clean : |
| 32 | -rm -f *~ $(objects) $(target) |
| 33 | |
| 34 | ## pattern rules |
| 35 | |
| 36 | %.o : %.cpp |
| 37 | $(CXX) -c $(CFLAGS) $(CXXFLAGS) -o $@ $< |
| 38 | |
| 39 | ### Makefile ends here |