1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#-----------------------------------------------------
# The locations where this program should be installed
INSTALL_DIR=/usr/local/bin
MAN_DIR=/usr/local/man/man1
# The location and names of the X11 libraries
LDIR = -L/usr/X11R6/lib
LIBS = -lXpm -lX11
# The include path to the X11 files
C_INCLUDE = -I. -I/usr/X11R6/include
#-----------------------------------------------------
CC = gcc
COPTS = -O2 -pipe -Wall -Wshadow
#COMPILE_FLAGS = -DDEBUG -DTEST -g
CFLAGS = $(COPTS) $(COMPILE_FLAGS) $(C_INCLUDE)
OBJ = asmem.o asmem_x.o read_mem.o x_color.o safecopy.o
all: asmem
@echo Ready.
asmem: $(OBJ)
$(CC) $(OBJ) $(LDIR) $(LIBS) -o asmem
asmem.o: asmem.c safecopy.h state.h asmem_x.h x_color.h
$(CC) -c $< $(CFLAGS) -o $@
safecopy.o: safecopy.c
$(CC) -c $< $(CFLAGS) -o $@
x_color.o: x_color.c
$(CC) -c $< $(CFLAGS) -o $@
read_mem.o: read_mem.h read_mem.c state.h
$(CC) -c $< $(CFLAGS) -o $@
asmem_x.o: asmem_x.c asmem_x.h x_color.h safecopy.h state.h\
background.xpm alphabet.xpm
$(CC) -c $< $(CFLAGS) -o $@
install:
@echo Installing asmem in $(INSTALL_DIR) ...
-@strip asmem
-@if [ -e $(INSTALL_DIR)/asmem ] ; then rm $(INSTALL_DIR)/asmem; fi
@cp asmem $(INSTALL_DIR)/asmem
@chmod 755 $(INSTALL_DIR)/asmem
@echo Installing the man page in $(MAN_DIR) ...
@cp asmem.man $(MAN_DIR)/asmem.1x
@chmod 644 $(MAN_DIR)/asmem.1x
@echo Done.
uninstall:
@echo Uninstalling asmem in $(INSTALL_DIR) ...
-@if [ -e $(INSTALL_DIR)/asmem ] ; then rm $(INSTALL_DIR)/asmem; fi
@echo Uninstalling the man page in $(MAN_DIR) ...
-@if [ -e $(MAN_DIR)/asmem.1x ] ; then rm $(MAN_DIR)/asmem.1x; fi
@echo Done.
clean:
rm -f $(OBJ) asmem
|