#******************************************************************* # ORTCAN Project - Makefile for Virtual CAN Api library compilation # # (C) Copyright 2002 by Pavel Pisa # # The ORTCAN Project is distributed under the # Library Gnu General Public Licence. # See file COPYING for details. # #******************************************************************* all : default default : library # Select compiler CC=gcc # Basic compilation flags CFLAGS += -Wall -Wstrict-prototypes #CFLAGS += -O2 CFLAGS += -I../include #CFLAGS += -I. CFLAGS += -ggdb # CFLAGS for the VCA library # note: some macro expansions require at least -O LCFLAGS= $(CFLAGS) LCFLAGS+= $(CPUFLAGS) # uncomment the next line if you want a shared library # LIB_SHARED = 1 LIB_OBJS = vca_base.lo vca_log.lo vca_utils.lo vcasdo_fsm.lo vcasdo_msg.lo ifndef LIB_SHARED LIB_PATH = ../lib LIBVCA = $(LIB_PATH)/libvca.a %.lo: %.c $(CC) -o $@ $(LCFLAGS) -c $< $(LIBVCA): $(LIB_OBJS) mkdir -p $(LIB_PATH) ar rcs $(LIBVCA) $^ ranlib $(LIBVCA) else %.lo: %.c $(CC) --shared -o $@ $(LCFLAGS) -c $< LIBVCA = libvca.so.0.0.4 $(LIBVCA): $(LIB_OBJS) ld --shared --soname=$(LIBVCA) -o $(LIBVCA) $^ ln -s -f $(LIBVCA) libvca.so endif library: $(LIBVCA) .SUFFIXES: .i .s %.c : %.i $(CC) -E $(CFLAGS) $< >$@ %.c : %.s $(CC) -S $(CFLAGS) $< dep: $(CC) $(CFLAGS) $(CPPFLAGS) -w -E -M *.c $(MORE_C_FILES) | \ sed 's/\.o/.lo/g' > depend depend: @touch depend clean: rm -f depend *.o *.lo *~ *.a *.so *.so.* rm -f $(LIBVCA) install: mkdir -p /usr/local/include/canvca cp -f ../include/*.h /usr/local/include/canvca cp -f $(LIB_PATH)/*.a /usr/local/lib -include depend