changeset 3:a07eb3757bf0

Improve the makefile very slightly.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 25 Feb 2015 04:13:08 +0200
parents ec2f8f6f1dc9
children 0990d9322fc8
files Makefile
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Feb 24 20:28:57 2015 +0200
+++ b/Makefile	Wed Feb 25 04:13:08 2015 +0200
@@ -1,23 +1,24 @@
 # dxa makefile
 # marko's originally, hacked up by cameron
 
-TARGET = dxa
+TARGETS = dxa
 OBJECTS = scan.o vector.o dump.o table.o label.o main.o
 VERSION = 0.1.3
 
 # choose the compiler and flags
 
 CC = gcc
-CFLAGS = -Wall -Wmissing-prototypes -O6
-#CFLAGS = -Wall -Wmissing-prototypes -ggdb
+CFLAGS = -g -O2 -W -Wall
+INSTALL = install
+PREFIX = /usr/local
 
 #CC = cc
 #CFLAGS = -O
 #CFLAGS = -O2
 
-all: $(TARGET)
+all: $(TARGETS)
 
-$(TARGET) : $(OBJECTS)
+dxa : $(OBJECTS)
 	$(CC) $(LDFLAGS) -o $@ $(OBJECTS)
 
 scan.o : structures.h proto.h options.h opcodes.h
@@ -28,7 +29,10 @@
 main.o : structures.h proto.h options.h opcodes.h
 
 clean:
-	rm -f $(OBJECTS) $(TARGET) core
+	rm -f $(OBJECTS) $(TARGETS) core
 
 dist: clean
 	cd ..;tar cvf dxa-$(VERSION).tar dxa-$(VERSION);gzip dxa-$(VERSION).tar
+
+install: all
+	@for fn in $(TARGETS); do echo " INSTALL $$fn $(PREFIX)/bin/"; $(INSTALL) -m 755 "$$fn" $(PREFIX)/bin/; done