aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile95
1 files changed, 95 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 00000000..fa4b3858
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,95 @@
+GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
+GTK_CFLAGS = -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/freetype2 -I/usr/include/libpng12
+SOUP_LIBS = -lsoup-2.2 -lglib-2.0 -lxml2 -lgnutls
+SOUP_CFLAGS = -I/usr/include/libsoup-2.2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2
+PACKAGE = hardinfo-0.4.2.1
+ARCHOPTS =
+
+CC = gcc -O3 $(ARCHOPTS)
+CCSLOW = gcc -O0
+CFLAGS = -fPIC -pipe -Wall -g $(GTK_CFLAGS) $(GLADE_CFLAGS) $(SOUP_CFLAGS) -I.
+
+# ----------------------------------------------------------------------------
+
+OBJECTS = hardinfo.o shell.o util.o iconcache.o loadgraph.o sha1.o md5.o \
+ menu.o stock.o callbacks.o expr.o report.o blowfish.o binreloc.o \
+ vendor.o socket.o fbench.o syncmanager.o
+MODULES = computer.so devices.so benchmark.so
+
+all: $(OBJECTS) $(MODULES)
+ $(CC) $(CFLAGS) -o hardinfo -Wl,-export-dynamic $(OBJECTS) $(GTK_LIBS) $(GTK_FLAGS) \
+ $(GLADE_LIBS) $(GLADE_FLAGS) $(SOUP_LIBS) $(SOUP_FLAGS)
+
+md5.o:
+ $(CCSLOW) $(CFLAGS) -c md5.c -o $@
+
+blowfish.o:
+ $(CCSLOW) $(CFLAGS) -c blowfish.c -o $@
+
+sha1.o:
+ $(CCSLOW) $(CFLAGS) -c sha1.c -o $@
+
+fbench.o:
+ $(CCSLOW) $(CFLAGS) -c fbench.c -o $@
+
+benchmark.so: benchmark.c
+ @echo "--- Module: $< ($@)"
+ $(CCSLOW) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) \
+ $(GLADE_LIBS) $(GLADE_FLAGS)
+ ln -sf ../$@ modules
+
+%.so: %.c
+ @echo "--- Module: $< ($@)"
+ $(CC) $(CFLAGS) -o $@ -shared $< $(GTK_FLAGS) $(GTK_LIBS) \
+ $(GLADE_LIBS) $(GLADE_FLAGS)
+ 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 '*** Creating directories...'
+ mkdir -p ${DESTDIR}/usr/bin
+ mkdir -p ${DESTDIR}/usr/local
+ mkdir -p ${DESTDIR}/usr/share/applications
+ mkdir -p ${DESTDIR}/usr/lib/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 -Lr modules/*.so ${DESTDIR}/usr/lib/hardinfo/modules
+
+ @echo '*** Installing pixmaps...'
+ cp -Lr 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:
+ makeinstaller