Makefile 1004 B

1234567891011121314151617181920212223242526
  1. PWD=$(shell pwd)
  2. INCS=-I$(PWD)/src/include
  3. DEBUG=-g -ggdb
  4. BASE_FLAGS=$(INCS) $(DEBUG) -I$(LIBEDIT_DIR)/src/ -fPIC
  5. PICKY=-O2
  6. CFLAGS=$(BASE_FLAGS) $(PICKY)
  7. CXXFLAGS=$(BASE_FLAGS)
  8. MYLIB=libks.a
  9. LIBS=-lncurses -lks -lpthread -lm
  10. LDFLAGS=-L.
  11. OBJS=src/ks.o src/ks_threadmutex.o src/ks_config.o src/ks_json.o src/ks_buffer.o src/mpool.o src/table.o src/table_util.o src/simclist.o
  12. SRC=src/ks.c src/ks_json.c src/ks_threadmutex.c src/ks_config.c src/ks_json.c src/ks_buffer.c src/mpool.c src/table.c src/table_util.c src/simclist.c
  13. HEADERS=src/include/ks_config.h src/include/ks.h src/include/ks_threadmutex.h src/include/ks_json.h src/include/ks_buffer.h src/include/mpool.h src/include/mpool_loc.h src/include/table.h src/include/table_loc.h src/include/simclist.h
  14. SOLINK=-shared -Xlinker -x
  15. all: $(MYLIB)
  16. $(MYLIB): $(OBJS) $(HEADERS) $(SRC)
  17. ar rcs $(MYLIB) $(OBJS)
  18. ranlib $(MYLIB)
  19. %.o: %.c $(HEADERS)
  20. $(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
  21. clean:
  22. rm -f *.o src/*.o libks.a *~ src/*~ src/include/*~