#******************************************************************* # 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 += -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 = ul_gsa.lo ul_dbuff.lo ifndef LIB_SHARED LIB_PATH = ../lib LIB = $(LIB_PATH)/libulut.a %.lo: %.c $(CC) -o $@ $(LCFLAGS) -c $< $(LIB): $(LIB_OBJS) mkdir -p $(LIB_PATH) ar rcs $(LIB) $^ ranlib $(LIB) 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: $(LIB) .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.* $(LIB) -include depend