Created
September 17, 2010 21:53
-
-
Save lucindo/585021 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CXX = g++ | |
| CPPFLAGS = -Wall -ansi -O2 | |
| LDFLAGS = -lACE | |
| bin = server client | |
| cpps := $(wildcard *.cpp) | |
| objects := $(foreach file, $(cpps), $(basename $(file)).o) | |
| link_objects := $(filter-out $(foreach b, $(bin), $b.o), $(objects)) | |
| all: obj binaries | |
| obj: $(objects) | |
| $(objects): %.o: %.cpp %.h | |
| $(CXX) $(CPPFLAGS) -c $< -o $@ | |
| binaries: $(bin) | |
| $(bin): | |
| $(CXX) $(CPPFLAGS) $(LDFLAGS) -o $@ $@.o $(link_objects) | |
| .PHONY: clean cleanbin realclean | |
| realclean: cleanbin clean | |
| cleanbin: | |
| -rm -f $(bin) | |
| clean: | |
| -rm -f *~ $(objects) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment