markman

Unnamed repository; edit this file 'description' to name the repository.
git clone git://edryd.org/markman
Log | Files | Refs | LICENSE

Makefile (1007B)


      1 # markman
      2 # See LICENSE file for copyright and license details.
      3 
      4 include config.mk
      5 
      6 EXE = markman
      7 SRC = $(wildcard *.c)
      8 OBJ = $(SRC:.c=.o)
      9 
     10 all: options $(EXE)
     11 
     12 options:
     13 	@echo $(EXE) build options:
     14 	@echo "CFLAGS  = $(CFLAGS)"
     15 	@echo "LDFLAGS = $(LDFLAGS)"
     16 
     17 .o:
     18 	@echo $(LD) $@
     19 	@$(LD) -o $@ $< $(LDFLAGS)
     20 
     21 .c.o:
     22 	@echo $(CC) $<
     23 	@$(CC) -c -o $@ $< $(CFLAGS)
     24 
     25 $(OBJ): config.h config.mk
     26 
     27 config.h:
     28 	@echo creating $@ from config.def.h
     29 	@cp config.def.h $@
     30 
     31 $(EXE): $(OBJ)
     32 	@echo $(CC) -o $@
     33 	@$(CC) -o $@ $(OBJ) $(LDFLAGS)
     34 
     35 clean:
     36 	@echo cleaning
     37 	@rm -f $(OBJ) $(EXE)
     38 
     39 install: all
     40 	@echo installing $(EXE) to $(DESTDIR)$(PREFIX)/bin
     41 	@mkdir -p $(DESTDIR)$(PREFIX)/bin
     42 	@cp -f $(EXE) $(DESTDIR)$(PREFIX)/bin
     43 	@chmod 755 $(DESTDIR)$(PREFIX)/bin/$(EXE)
     44 
     45 uninstall:
     46 	@echo removing $(EXE) from $(DESTDIR)$(PREFIX)/bin
     47 	@rm -f $(DESTDIR)$(PREFIX)/bin/$(EXE)
     48 	@echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
     49 	@rm -f $(DESTDIR)$(MANPREFIX)/man1/$(EXE).1
     50 
     51 .PHONY: all options clean install uninstall