blob: 6d34e67e90c2e31ad5047bb104739f8340889b27 (
plain) (
tree)
|
|
# equivalent to #define in c code
VERSION = 0.12.0
CC = gcc
CFLAGS = '-DVERSION="$(VERSION)"' -w -Os -s #size
#CFLAGS = -w -O3 -s
#CFLAGS = -w -g #debug
OBJECTS = op.o \
progP12.o \
progP16.o \
progP18.o \
progP24.o \
progEEPROM.o \
progAVR.o \
fileIO.o \
deviceRW.o \
I2CSPI.o \
strings.o
LDFLAG = -lrt
all: op
op : $(OBJECTS)
@echo "\t LD $@"
@$(CC) $(OBJECTS) -o op $(LDFLAG)
@rm $(OBJECTS)
%.o : %.c
@echo "\t CC $@"
@$(CC) $(CFLAGS) -c $<
clean:
@echo "\t CLEAN ALL"
@rm -f op $(OBJECTS)
prefix := /usr/local
install: op
@echo "\t Installing op"
@test -d $(prefix) || mkdir $(prefix)
@test -d $(prefix)/bin || mkdir $(prefix)/bin
@install -m 0755 op $(prefix)/bin;
package:
@echo "\t Creating op_$(VERSION).tar.gz"
@mkdir op-$(VERSION)
@cp *.c *.h gpl-2.0.txt Makefile readme utils/*.c op-$(VERSION)
@tar -czf op_$(VERSION).tar.gz op-$(VERSION)
@rm -rf op-$(VERSION)
.PHONY: all clean install package
|