SLIB = libScalar_Product.a
APP=app.x
CC = gcc
CFLAGS = -O3
LIBPATH = .
INSTPATH = /usr/local
$(APP): main.o $(SLIB)
$(CC) $(CFLAGS) -o $@ main.o -L$(LIBPATH) -lScalar_Product
.c.o:
@echo "Compiling" $<
$(CC) -c $<
$(SLIB): Scalar_Product.o
ar -cru $@ $<
ranlib $@
clean:
-rm -f *.o *.a $(APP)
install:
@cp -p $(APP) $(INSTPATH)/bin ;\
chown root:root $(INSTPATH)/bin/$(APP) ;\
cp -p $(SLIB) $(INSTPATH)/lib ;\
chown root:root $(INSTPATH)/lib/$(SLIB) ;\
echo "Install $(APP) and $(SLIB) into $(INSTPATH)"
uninstall:
-@rm -f $(INSTPATH)/bin/$(APP)
-@rm -f $(INSTPATH)/lib/$(SLIB)
@echo "Removed $(APP) and $(SLIB) from $(INSTPATH)"
|