Created
October 3, 2011 19:25
-
-
Save r2p2/1259984 to your computer and use it in GitHub Desktop.
Makefile
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
| #LIB=liborm_core | |
| #VERSION=1.0 | |
| TARGET=lib$(LIBNAME).so | |
| CC=g++ | |
| CFLAGS=-fPIC -g -c -Wall -Weffc++ -Iinclude | |
| LDFLAGS=-shared -Wl,-soname,$(TARGET) -Lbuild -lpthread -lrt | |
| # checks to subdir level, add more if requiered | |
| SOURCES=$(wildcard **/*.cpp) $(wildcard **/**/*.cpp) | |
| OBJS=$(SOURCES:.cpp=.o) | |
| all: dirs $(SOURCES) $(TARGET) | |
| dirs: | |
| cd src && find . -type d -exec mkdir -p ../build/{} \; | |
| $(TARGET): $(OBJS) | |
| $(CC) $(LDFLAGS) $(subst src/,build/,$(OBJS)) -o bin/$@ | |
| .cpp.o: | |
| $(CC) $(CFLAGS) $< -o build/$(subst src/,,$@) | |
| clean: | |
| rm -rf build/* | |
| rm -rf bin/* | |
| build: | |
| tar cfv dist/$(TARGET).tar bin/$(TARGET).so include/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment