add makefile

This commit is contained in:
Kelvin Sherlock 2017-08-08 17:45:57 -04:00
parent deb675f221
commit 5eabe7cd0c
1 changed files with 31 additions and 0 deletions

31
Makefile Normal file
View File

@ -0,0 +1,31 @@
LINK.o = $(LINK.cc)
CXXFLAGS = -std=c++11 -Wall -Wno-sign-compare
CPPFLAGS = -I include/afp/
OBJS = o/finder_info.o o/resource_fork.o
# also cygwin...
ifeq ($(MSYSTEM),MSYS)
OBJS += o/remap_os_error.o
endif
ifneq ($(OS),Windows_NT)
OBJS += o/xattr.o
endif
libafp.a : $(OBJS)
ar rcs $@ $^
o :
mkdir $@
o/finder_info.o : src/finder_info.cpp include/afp/finder_info.h
o/resource_fork.o : src/resource_fork.cpp include/afp/resource_fork.h
o/remap_os_error.o : src/remap_os_error.c
o/xattr.o : src/xattr.c include/afp/xattr.h
o/%.o: src/%.c | o
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
o/%.o: src/%.cpp | o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<