chiark / gitweb /
[PATCH] The following patch fixes a warning when compiling chassis_id
[elogind.git] / extras / chassis_id / Makefile
index 1b641cafdad8fbdd8310e81894d9d0e95805d689..ae5c95961c5aa6870a0c2c0168fa12cd56d765d8 100644 (file)
 # * Authors: Atul Sabharwal
 # *          
 # *
-CFLAGS = -g 
+
 TARGET = chassis_id
 
-all:   chassis_id  
+exec_prefix =   ${prefix}
+sbindir =       ${exec_prefix}/sbin
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA  = ${INSTALL} -m 644
+all:   chassis_id
 
+ifneq ($(strip $(USE_KLIBC)),true)
 chassis_id:    chassis_id.c table.c
-       gcc -o $(TARGET) $(CFLAGS) chassis_id.c table.c
+       $(QUIET) $(CC) -o $(TARGET) $(CFLAGS) chassis_id.c table.c
+
+install: all
+       $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(sbindir)/$(TARGET)
+else
+chassis_id:
+       @echo
+       @echo "!!! chassis_id is incompatible with klibc !!!"
+       @echo
+       @exit 0
 
-clean: 
+install: all
+endif
+
+clean:
        rm -rf core a.out $(TARGET)
+