aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile113
1 files changed, 113 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..d929653c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,113 @@
+GTK_LIBS = -lpthread -lgthread-2.0 -lrt -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
+GTK_CFLAGS = -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12
+SOUP_LIBS =
+SOUP_CFLAGS =
+PACKAGE = hardinfo-0.5c
+ARCHOPTS =
+LIBDIR = /usr/lib
+
+CCFLAGS = -fPIC -pipe -Wall -g
+CFLAGS = $(GTK_CFLAGS) $(SOUP_CFLAGS) -I.
+CC = gcc $(ARCHOPTS) -g
+CCSLOW = gcc -O0 -g
+
+# ----------------------------------------------------------------------------
+
+OBJECTS = hardinfo.o shell.o util.o iconcache.o loadgraph.o \
+ menu.o stock.o callbacks.o expr.o report.o binreloc.o \
+ vendor.o socket.o syncmanager.o
+BENCHMARK_OBJECTS = fbench.o sha1.o blowfish.o md5.o nqueens.o fftbench.o
+
+MODULES = computer.so devices.so benchmark.so network.so
+
+all: $(OBJECTS) $(MODULES) hardinfo
+
+hardinfo:
+ $(CC) $(CCFLAGS) -o hardinfo -Wl,-export-dynamic $(OBJECTS) $(GTK_LIBS) \
+ $(SOUP_LIBS)
+
+md5.o:
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c md5.c -o $@
+
+blowfish.o:
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c blowfish.c -o $@
+
+sha1.o:
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c sha1.c -o $@
+
+fbench.o:
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c fbench.c -o $@
+
+fftbench.o:
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c fftbench.c -o $@
+
+nqueens.o:
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -c nqueens.c -o $@
+
+benchmark.so: benchmark.c
+ @echo "--- Module: $< ($@)"
+ make $(BENCHMARK_OBJECTS)
+ $(CCSLOW) $(CCFLAGS) $(CFLAGS) -o $@ -shared $< $(BENCHMARK_OBJECTS) \
+ $(GTK_FLAGS) $(GTK_LIBS)
+ ln -sf ../$@ modules
+
+%.so: %.c
+ @echo "--- Module: $< ($@)"
+ $(CC) $(CCFLAGS) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS)
+ ln -sf ../$@ modules
+
+clean:
+ rm -rf .xvpics pixmaps/.xvpics *.o *.so hardinfo modules/*.so report
+ find . -name \*~ -exec rm -v {} \;
+ find . -name x86 -type l -exec rm -v {} \;
+
+dist-clean: clean
+ rm -rf Makefile debian/hardinfo/ config.h arch/this
+
+package: dist-clean
+ @echo "Creating tar.gz..."
+ cd .. && tar czf $(PACKAGE).tar.gz $(PACKAGE)/* && cd $(PACKAGE)
+ @echo "Creating tar.bz2..."
+ cd .. && tar cjf $(PACKAGE).tar.bz2 $(PACKAGE)/* && cd $(PACKAGE)
+
+deb: dist-clean
+ @echo "Creating deb..."
+ dpkg-buildpackage -rfakeroot -k${USER}
+
+install: all
+ @echo '*** Cleaning up installation...'
+ rm -rf ${DESTDIR}${LIBDIR}/hardinfo/modules ${DESTDIR}/usr/share/hardinfo/pixmaps
+
+ @echo '*** Creating directories...'
+ mkdir -p ${DESTDIR}/usr/bin
+ mkdir -p ${DESTDIR}/usr/local
+ mkdir -p ${DESTDIR}/usr/share/applications
+
+
+ mkdir -p ${DESTDIR}${LIBDIR}/hardinfo/modules
+ mkdir -p ${DESTDIR}/usr/share/hardinfo/pixmaps
+
+ @echo '*** Installing icon...'
+ cp hardinfo.desktop ${DESTDIR}/usr/share/applications
+
+ @echo '*** Installing executable...'
+ cp hardinfo ${DESTDIR}/usr/bin/hardinfo
+
+ @echo '*** Installing modules...'
+ cp -Lvr modules/*.so ${DESTDIR}${LIBDIR}/hardinfo/modules
+
+ @echo '*** Installing pixmaps...'
+ cp -Lvr pixmaps/* ${DESTDIR}/usr/share/hardinfo/pixmaps
+
+ @echo '*** Installing misc data...'
+ cp benchmark.conf ${DESTDIR}/usr/share/hardinfo
+ cp benchmark.data ${DESTDIR}/usr/share/hardinfo
+
+ @echo '*** Fixing permissions...'
+ chmod 755 ${DESTDIR}/usr/bin/hardinfo
+
+ @echo '*** Done installing.'
+
+installer:
+ makepackage
+