eleni@4: # change the following line to install to a different prefix eleni@4: PREFIX = /usr/local eleni@4: eleni@0: src = $(wildcard src/*.c) eleni@0: obj = $(src:.c=.o) eleni@0: dep = $(obj:.o=.d) eleni@0: bin = dtms eleni@0: eleni@0: dbg = -g eleni@0: opt = -O0 eleni@0: eleni@4: CFLAGS = -pedantic -Wall -std=gnu99 -DPREFIX=\"$(PREFIX)\" $(dbg) eleni@0: eleni@0: $(bin): $(obj) eleni@0: $(CC) -o $@ $(obj) $(LDFLAGS) eleni@0: eleni@0: -include $(dep) eleni@0: eleni@0: %.d: %.c eleni@0: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ eleni@0: eleni@0: .PHONY: clean eleni@0: clean: eleni@0: rm -f $(obj) $(bin) $(dep) eleni@4: eleni@4: .PHONY: install eleni@4: install: $(bin) eleni@4: mkdir -p $(PREFIX)/bin $(PREFIX)/share/dtms eleni@4: cp $(bin) $(PREFIX)/bin/$(bin) eleni@4: chown root $(PREFIX)/bin/$(bin) eleni@4: chmod +s $(PREFIX)/bin/$(bin) eleni@4: cp data/dtms.mp3 $(PREFIX)/share/dtms/dtms.mp3 eleni@4: eleni@4: .PHONY: uninstall eleni@4: uninstall: eleni@4: rm -f $(PREFIX)/bin/$(bin) eleni@4: rm -f $(PREFIX)/share/dtms/dtms.mp3 eleni@4: rmdir $(PREFIX)/share/dtms eleni@4: eleni@4: