Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 1 | # |
| 2 | # Makefile for nvram utility |
| 3 | # |
| 4 | # (C) 2005-2008 coresystems GmbH |
| 5 | # written by Stefan Reinauer <stepan@coresystems.de> |
| 6 | # |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 7 | |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 8 | PROGRAM = nvramtool |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 9 | |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 10 | CC = gcc |
| 11 | STRIP = strip |
| 12 | INSTALL = /usr/bin/install |
| 13 | PREFIX = /usr/local |
| 14 | CFLAGS = -O2 -g -Wall -W |
| 15 | #CFLAGS = -Os -Wall |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 16 | |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 17 | OBJS = cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \ |
| 18 | hexdump.o input_file.o layout.o layout_file.o lbtable.o \ |
| 19 | nvramtool.o opts.o reg_expr.o |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 20 | |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 21 | all: dep $(PROGRAM) |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 22 | |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 23 | $(PROGRAM): $(OBJS) |
| 24 | $(CC) -o $(PROGRAM) $(OBJS) $(LDFLAGS) |
| 25 | $(STRIP) $(STRIP_ARGS) $(PROGRAM) |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 26 | |
| 27 | clean: |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 28 | rm -f $(PROGRAM) *.o |
Stefan Reinauer | 6540ae5 | 2007-07-12 16:35:42 +0000 | [diff] [blame] | 29 | |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 30 | distclean: clean |
| 31 | rm -f .dependencies |
| 32 | |
| 33 | dep: |
| 34 | @$(CC) -MM *.c > .dependencies |
| 35 | |
| 36 | install: $(PROGRAM) |
| 37 | $(INSTALL) $(PROGRAM) $(PREFIX)/sbin |
| 38 | mkdir -p $(PREFIX)/share/man/man1 |
Uwe Hermann | 50f37b0 | 2008-10-31 05:40:04 +0000 | [diff] [blame] | 39 | $(INSTALL) $(PROGRAM).8 $(PREFIX)/share/man/man8 |
Stefan Reinauer | a67aab7 | 2008-09-27 10:08:28 +0000 | [diff] [blame] | 40 | |
| 41 | .PHONY: all clean distclean dep |
| 42 | |
| 43 | -include .dependencies |